fix service pds, bsky
This commit is contained in:
32
patching/index.js
Normal file
32
patching/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
/* eslint-env node */
|
||||
// https://github.com/bluesky-social/atproto/blob/main/services/pds/index.js
|
||||
'use strict'
|
||||
|
||||
const {
|
||||
PDS,
|
||||
envToCfg,
|
||||
envToSecrets,
|
||||
httpLogger,
|
||||
readEnv,
|
||||
} = require('/app/packages/pds')
|
||||
const pkg = require('/app/packages/pds/package.json')
|
||||
|
||||
const main = async () => {
|
||||
const env = readEnv()
|
||||
env.version ??= pkg.version
|
||||
const cfg = envToCfg(env)
|
||||
const secrets = envToSecrets(env)
|
||||
const pds = await PDS.create(cfg, secrets)
|
||||
|
||||
await pds.start()
|
||||
|
||||
httpLogger.info('pds is running')
|
||||
// Graceful shutdown (see also https://aws.amazon.com/blogs/containers/graceful-shutdowns-with-ecs/)
|
||||
process.on('SIGTERM', async () => {
|
||||
httpLogger.info('pds is stopping')
|
||||
await pds.destroy()
|
||||
httpLogger.info('pds is stopped')
|
||||
})
|
||||
}
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user