Skip to content

Commit

Permalink
tidy/fix tests and service entrypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
devinivy committed Feb 19, 2024
1 parent e710c21 commit cd019bf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/ozone/tests/moderation-events.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ describe('moderation-events', () => {
})
const addEvent = await tagEvent({ add: ['L1', 'L2'], remove: [] })
const addAndRemoveEvent = await tagEvent({ add: ['L3'], remove: ['L2'] })
const [addFinder, addAndRemoveFinder, removeFinder] = await Promise.all([
const [addFinder, addAndRemoveFinder, _removeFinder] = await Promise.all([
queryModerationEvents({
addedTags: ['L1'],
}),
Expand Down
8 changes: 5 additions & 3 deletions packages/pds/tests/file-uploads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ describe('file uploads', () => {

it('handles client abort', async () => {
const abortController = new AbortController()
const _putTemp = DiskBlobStore.prototype.putTemp
DiskBlobStore.prototype.putTemp = function (...args) {
const BlobStore = ctx.blobstore('did:invalid')
.constructor as typeof DiskBlobStore
const _putTemp = BlobStore.prototype.putTemp
BlobStore.prototype.putTemp = function (...args) {
// Abort just as processing blob in packages/pds/src/services/repo/blobs.ts
process.nextTick(() => abortController.abort())
return _putTemp.call(this, ...args)
Expand All @@ -64,7 +66,7 @@ describe('file uploads', () => {
)
await expect(response).rejects.toThrow('operation was aborted')
// Cleanup
DiskBlobStore.prototype.putTemp = _putTemp
BlobStore.prototype.putTemp = _putTemp
// This test would fail from an uncaught exception: this grace period gives time for that to surface
await new Promise((res) => setTimeout(res, 10))
})
Expand Down
6 changes: 5 additions & 1 deletion services/bsky/indexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
require('dd-trace/init') // Only works with commonjs

// Tracer code above must come before anything else
const { CloudfrontInvalidator, BunnyInvalidator } = require('@atproto/aws')
const {
CloudfrontInvalidator,
BunnyInvalidator,
MultiImageInvalidator,
} = require('@atproto/aws')
const {
IndexerConfig,
BskyIndexer,
Expand Down
5 changes: 0 additions & 5 deletions services/pds/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ const main = async () => {
// Graceful shutdown (see also https://aws.amazon.com/blogs/containers/graceful-shutdowns-with-ecs/)
process.on('SIGTERM', async () => {
httpLogger.info('pds is stopping')

periodicModerationActionReversal?.destroy()
await periodicModerationActionReversalRunning

await pds.destroy()

httpLogger.info('pds is stopped')
})
}
Expand Down

0 comments on commit cd019bf

Please sign in to comment.