Skip to content

Commit

Permalink
Remove excess logging from adding features
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjstevens committed Jul 2, 2024
1 parent f3ac78d commit 3af1d82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 1 addition & 8 deletions packages/apollo-common/src/AssemblySpecificChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}"`)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!')
Expand Down

0 comments on commit 3af1d82

Please sign in to comment.