Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/moderation-api-v2' into multi-pd…
Browse files Browse the repository at this point in the history
…s-auth-moderation-api-v2
  • Loading branch information
devinivy committed Nov 22, 2023
2 parents db27039 + d21b3d9 commit 1d7525b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/bsky/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type { ServerConfigValues } from './config'
export type { MountedAlgos } from './feed-gen/types'
export { ServerConfig } from './config'
export { Database, PrimaryDatabase, DatabaseCoordinator } from './db'
export { PeriodicModerationEventReversal } from './db/periodic-moderation-action-reversal'
export { PeriodicModerationEventReversal } from './db/periodic-moderation-event-reversal'
export { Redis } from './redis'
export { ViewMaintainer } from './db/views'
export { AppContext } from './context'
Expand Down
14 changes: 7 additions & 7 deletions services/bsky/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const {
BskyAppView,
ViewMaintainer,
makeAlgos,
PeriodicModerationActionReversal,
PeriodicModerationEventReversal,
} = require('@atproto/bsky')

const main = async () => {
Expand Down Expand Up @@ -110,18 +110,18 @@ const main = async () => {
const viewMaintainer = new ViewMaintainer(migrateDb, 1800)
const viewMaintainerRunning = viewMaintainer.run()

const periodicModerationActionReversal = new PeriodicModerationActionReversal(
const periodicModerationEventReversal = new PeriodicModerationEventReversal(
bsky.ctx,
)
const periodicModerationActionReversalRunning =
periodicModerationActionReversal.run()
const periodicModerationEventReversalRunning =
periodicModerationEventReversal.run()

await bsky.start()
// Graceful shutdown (see also https://aws.amazon.com/blogs/containers/graceful-shutdowns-with-ecs/)
process.on('SIGTERM', async () => {
// Gracefully shutdown periodic-moderation-action-reversal before destroying bsky instance
periodicModerationActionReversal.destroy()
await periodicModerationActionReversalRunning
// Gracefully shutdown periodic-moderation-event-reversal before destroying bsky instance
periodicModerationEventReversal.destroy()
await periodicModerationEventReversalRunning
await bsky.destroy()
viewMaintainer.destroy()
await viewMaintainerRunning
Expand Down

0 comments on commit 1d7525b

Please sign in to comment.