mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
refactor: migrate custom fields to transactions
refactor: extract functions to api domain refactor: strict custom field parsing refactor: remove rundown cache utilities refactor: directory restructure
This commit is contained in:
@@ -2,11 +2,11 @@ import { writeFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
import { ONTIME_VERSION } from '../ONTIME_VERSION.js';
|
||||
import { get } from '../services/rundown-service/rundownCache.js';
|
||||
import { getState } from '../stores/runtimeState.js';
|
||||
import { publicDir } from '../setup/index.js';
|
||||
|
||||
import { ensureDirectory } from './fileManagement.js';
|
||||
import { getCurrentRundown } from '../api-data/rundown/rundown.dao.js';
|
||||
/**
|
||||
* Writes a file to the crash report location
|
||||
* @param fileName
|
||||
@@ -31,7 +31,7 @@ function writeToFile(fileName: string, content: object) {
|
||||
export function generateCrashReport(maybeError: unknown) {
|
||||
const timeNow = new Date().toISOString();
|
||||
const runtimeState = getState();
|
||||
const rundownState = get();
|
||||
const currentRundown = getCurrentRundown();
|
||||
const error =
|
||||
maybeError instanceof Error
|
||||
? {
|
||||
@@ -45,7 +45,7 @@ export function generateCrashReport(maybeError: unknown) {
|
||||
version: ONTIME_VERSION,
|
||||
error,
|
||||
runtimeState,
|
||||
rundownState,
|
||||
currentRundown,
|
||||
};
|
||||
|
||||
writeToFile(`crash-log-${timeNow}.log`, crashReport);
|
||||
|
||||
Reference in New Issue
Block a user