Add export logs (#978)
This commit is contained in:
commit
6971e07b4d
|
@ -34,6 +34,7 @@ import { CustomError } from 'utils/error';
|
||||||
import { getLocalUserDetails } from 'utils/user';
|
import { getLocalUserDetails } from 'utils/user';
|
||||||
import { AppContext } from 'pages/_app';
|
import { AppContext } from 'pages/_app';
|
||||||
import { getExportDirectoryDoesNotExistMessage } from 'utils/ui';
|
import { getExportDirectoryDoesNotExistMessage } from 'utils/ui';
|
||||||
|
import { addLogLine } from 'utils/logging';
|
||||||
|
|
||||||
const ExportFolderPathContainer = styled('span')`
|
const ExportFolderPathContainer = styled('span')`
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
@ -289,6 +290,11 @@ export default function ExportModal(props: Props) {
|
||||||
const pausedStageProgress = exportRecord.progress;
|
const pausedStageProgress = exportRecord.progress;
|
||||||
setExportProgress(pausedStageProgress);
|
setExportProgress(pausedStageProgress);
|
||||||
|
|
||||||
|
addLogLine(
|
||||||
|
`resuming export, pausedStageProgress: ${JSON.stringify(
|
||||||
|
pausedStageProgress
|
||||||
|
)}`
|
||||||
|
);
|
||||||
const updateExportStatsWithOffset = (progress: ExportProgress) =>
|
const updateExportStatsWithOffset = (progress: ExportProgress) =>
|
||||||
updateExportProgress({
|
updateExportProgress({
|
||||||
current: pausedStageProgress.current + progress.current,
|
current: pausedStageProgress.current + progress.current,
|
||||||
|
|
|
@ -50,6 +50,7 @@ import { FILE_TYPE, TYPE_JPEG, TYPE_JPG } from 'constants/file';
|
||||||
import { ExportType, ExportNotification, RecordType } from 'constants/export';
|
import { ExportType, ExportNotification, RecordType } from 'constants/export';
|
||||||
import { ElectronAPIs } from 'types/electron';
|
import { ElectronAPIs } from 'types/electron';
|
||||||
import { CustomError } from 'utils/error';
|
import { CustomError } from 'utils/error';
|
||||||
|
import { addLogLine } from 'utils/logging';
|
||||||
|
|
||||||
const LATEST_EXPORT_VERSION = 1;
|
const LATEST_EXPORT_VERSION = 1;
|
||||||
const EXPORT_RECORD_FILE_NAME = 'export_status.json';
|
const EXPORT_RECORD_FILE_NAME = 'export_status.json';
|
||||||
|
@ -129,6 +130,14 @@ class ExportService {
|
||||||
}
|
}
|
||||||
const exportRecord = await this.getExportRecord(exportDir);
|
const exportRecord = await this.getExportRecord(exportDir);
|
||||||
|
|
||||||
|
addLogLine(
|
||||||
|
`export stats -> progress: ${JSON.stringify(
|
||||||
|
exportRecord.progress
|
||||||
|
)} stage:${exportRecord.stage} queuedFilesCount: ${
|
||||||
|
exportRecord?.queuedFiles?.length
|
||||||
|
} exportedFiles: ${exportRecord?.exportedFiles?.length}
|
||||||
|
failedFiles: ${exportRecord?.failedFiles?.length}`
|
||||||
|
);
|
||||||
if (exportType === ExportType.NEW) {
|
if (exportType === ExportType.NEW) {
|
||||||
filesToExport = getFilesUploadedAfterLastExport(
|
filesToExport = getFilesUploadedAfterLastExport(
|
||||||
userPersonalFiles,
|
userPersonalFiles,
|
||||||
|
@ -145,6 +154,10 @@ class ExportService {
|
||||||
exportRecord
|
exportRecord
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
addLogLine(
|
||||||
|
`starting export, type: ${exportType}, filesToExportCount: ${filesToExport?.length}, userPersonalFileCount: ${userPersonalFiles?.length}`
|
||||||
|
);
|
||||||
|
|
||||||
const collectionIDPathMap: CollectionIDPathMap =
|
const collectionIDPathMap: CollectionIDPathMap =
|
||||||
getCollectionIDPathMapFromExportRecord(exportRecord);
|
getCollectionIDPathMapFromExportRecord(exportRecord);
|
||||||
const newCollections = getCollectionsCreatedAfterLastExport(
|
const newCollections = getCollectionsCreatedAfterLastExport(
|
||||||
|
|
Loading…
Reference in a new issue