Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update shutdown process #1813

Merged
merged 11 commits into from
Sep 6, 2023
Merged

refactor: update shutdown process #1813

merged 11 commits into from
Sep 6, 2023

Conversation

mkurapov
Copy link
Contributor

@mkurapov mkurapov commented Sep 1, 2023

Changes proposed in this pull request

  • Moves ILP connector server into app, instead of having it separately defined in index.ts
  • Updates app.shutdown function to properly close all running servers (in both auth and backend packages)
  • Make sure we are correctly handling multiple SIGTERM events
  • Remove unused closeEmitter

Context

Related to: #1805 (comment)

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Documentation added
  • Make sure that all checks pass
  • Postman collection updated

@netlify
Copy link

netlify bot commented Sep 1, 2023

Deploy Preview for brilliant-pasca-3e80ec ready!

Name Link
🔨 Latest commit 881705e
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/64f8569748a4e600078defd6
😎 Deploy Preview https://deploy-preview-1813--brilliant-pasca-3e80ec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added pkg: backend Changes in the backend package. type: source Changes business logic pkg: auth Changes in the GNAP auth package. labels Sep 1, 2023
@mkurapov mkurapov changed the title Mk/1763/update shutdown refactor: update shutdown process Sep 1, 2023
Comment on lines +209 to +210
connectorApp: Promise<ConnectorApp>
tigerbeetle: Promise<TigerbeetleClient>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adds these services so they are properly typed when doing container.use


export interface AppContextData {
logger: Logger
closeEmitter: EventEmitter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't used

Comment on lines -458 to -460
await tigerbeetle.destroy()
tigerbeetle.destroy()
const redis = await container.use('redis')
await redis.disconnect()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not async functions

@@ -37,6 +37,6 @@ export class OutgoingIlpPlugin implements IlpPlugin {
}

export interface IlpPluginOptions {
sourceAccount: LiquidityAccount
sourceAccount: ConnectorAccount
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updating to the the correct type

@mkurapov mkurapov marked this pull request as ready for review September 1, 2023 18:26
@github-actions github-actions bot added the type: tests Testing related label Sep 6, 2023
@@ -158,12 +152,12 @@ export class App {
})

// Setup Apollo
this.apolloServer = new ApolloServer({
const apolloServer = new ApolloServer({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.apolloServer wasn't used outside of this function

Copy link
Member

@sabineschaller sabineschaller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup! It'll probably give me merge conflicts 🙃

@mkurapov mkurapov merged commit 0ef5915 into main Sep 6, 2023
@mkurapov mkurapov deleted the mk/1763/update-shutdown branch September 6, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: auth Changes in the GNAP auth package. pkg: backend Changes in the backend package. type: source Changes business logic type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants