ai/at
1
0

fix service pds, bsky

This commit is contained in:
2025-12-02 21:37:41 +09:00
parent 2f5736ffde
commit 37b5919a7f
3 changed files with 221 additions and 18 deletions

32
patching/index.js Normal file
View 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()