Skip to content

Commit

Permalink
fix: missing dateEnd
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoSilvestr committed Dec 13, 2023
1 parent 09fcd65 commit d9112d6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker/src/plugins/compounds/sync/firstCompoundsImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async function firstCompoundImport(connection) {
{ lastDocument },
'first',
);
progress.dateEnd = Date.now();
progress.state = 'updated';
await connection.setProgress(progress);
// create indexes on the compounds collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ async function incrementalCompoundImport(connection) {
{ lastDocument },
'incremental',
);
progress.dateEnd = Date.now();
await connection.setProgress(progress);
}
debug.info('Compounds collection updated.');
} catch (e) {
Expand Down
1 change: 1 addition & 0 deletions docker/src/plugins/pubmeds/sync/firstPubmedsImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ async function firstPubmedImport(connection) {
);
// set progress to updated
progress.state = 'updated';
progress.dateEnd = Date.now();
await connection.setProgress(progress);
// create indexes
const collection = await connection.getCollection('pubmeds');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ async function incrementalPubmedImport(connection) {
pmidToCid,
'incremental',
);
progress.dateEnd = Date.now();
}
} catch (e) {
if (connection) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ async function firstSubstanceImport(connection) {
'first',
);
progress.state = 'updating';
progress.dateEnd = Date.now();
await connection.setProgress(progress);
await importSubstanceFiles(
connection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ async function incrementalSubstanceImport(connection) {
allFiles = await syncSubstanceFolder(connection, 'incremental');
}
const progress = await connection.getProgress('substances');

if (progress.state !== 'updated') {
throw new Error('Should never happens.');
}
Expand Down Expand Up @@ -56,6 +55,8 @@ async function incrementalSubstanceImport(connection) {
{ lastDocument },
'incremental',
);
progress.dateEnd = Date.now();
await connection.setProgress(progress);
}
} catch (e) {
if (connection) {
Expand Down

0 comments on commit d9112d6

Please sign in to comment.