diff --git a/packages/apollo-common/src/AssemblySpecificChange.ts b/packages/apollo-common/src/AssemblySpecificChange.ts index f93f3aeb7..70284d115 100644 --- a/packages/apollo-common/src/AssemblySpecificChange.ts +++ b/packages/apollo-common/src/AssemblySpecificChange.ts @@ -227,23 +227,16 @@ export abstract class AssemblySpecificChange extends Change { const featureIds: string[] = [] const newFeature = createFeature(gff3Feature, refSeqDoc._id, featureIds) - logger.debug?.(`So far feature ids are: ${featureIds.toString()}`) // Add value to gffId newFeature.attributes?._id ? (newFeature.gffId = newFeature.attributes?._id.toString()) : (newFeature.gffId = newFeature._id) - logger.debug?.( - `********************* Assembly specific change create ${JSON.stringify( - newFeature, - )}`, - ) // Add into Mongo // We cannot use Mongo 'session' / transaction here because Mongo has 16 MB limit for transaction - const [newFeatureDoc] = await featureModel.create([ + await featureModel.create([ { allIds: featureIds, ...newFeature, user, status: -1 }, ]) - logger.verbose?.(`Added docId "${newFeatureDoc._id}"`) } } diff --git a/packages/apollo-shared/src/Changes/AddFeaturesFromFileChange.ts b/packages/apollo-shared/src/Changes/AddFeaturesFromFileChange.ts index 9df38fc96..392ba607e 100644 --- a/packages/apollo-shared/src/Changes/AddFeaturesFromFileChange.ts +++ b/packages/apollo-shared/src/Changes/AddFeaturesFromFileChange.ts @@ -91,13 +91,17 @@ export class AddFeaturesFromFileChange extends AssemblySpecificChange { const featureStream = filesService.parseGFF3( filesService.getFileStream(fileDoc), ) + let featureCount = 0 for await (const f of featureStream) { const gff3Feature = f as GFF3Feature - logger.verbose?.(`ENTRY=${JSON.stringify(gff3Feature)}`) // Add new feature into database // We cannot use Mongo 'session' / transaction here because Mongo has 16 MB limit for transaction await this.addFeatureIntoDb(gff3Feature, backend) + featureCount++ + if (featureCount % 1000 === 0) { + logger.debug?.(`Processed ${featureCount} features`) + } } } logger.debug?.('New features added into database!')