From cd019bfb3b7bd26bdc5e24c32052c4495e81b8c6 Mon Sep 17 00:00:00 2001 From: Devin Ivy Date: Mon, 19 Feb 2024 16:56:20 -0500 Subject: [PATCH] tidy/fix tests and service entrypoints --- packages/ozone/tests/moderation-events.test.ts | 2 +- packages/pds/tests/file-uploads.test.ts | 8 +++++--- services/bsky/indexer.js | 6 +++++- services/pds/index.js | 5 ----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/ozone/tests/moderation-events.test.ts b/packages/ozone/tests/moderation-events.test.ts index 12277ea77a4..f283a19ca99 100644 --- a/packages/ozone/tests/moderation-events.test.ts +++ b/packages/ozone/tests/moderation-events.test.ts @@ -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'], }), diff --git a/packages/pds/tests/file-uploads.test.ts b/packages/pds/tests/file-uploads.test.ts index 2333630a5d6..0ce419a7209 100644 --- a/packages/pds/tests/file-uploads.test.ts +++ b/packages/pds/tests/file-uploads.test.ts @@ -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) @@ -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)) }) diff --git a/services/bsky/indexer.js b/services/bsky/indexer.js index ea633ffad81..2f40254bb55 100644 --- a/services/bsky/indexer.js +++ b/services/bsky/indexer.js @@ -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, diff --git a/services/pds/index.js b/services/pds/index.js index 4efe4b95735..214350bcdc8 100644 --- a/services/pds/index.js +++ b/services/pds/index.js @@ -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') }) }