Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8fe9847

Browse files
feat(sync-engine): add close() method to release database connections (#230)
1 parent9ddcea5 commit8fe9847

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

‎docs/typescript.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,11 @@ await sync.syncBackfill({
139139

140140
>**Note:**
141141
>For large Stripe accounts (more than 10,000 objects), it is recommended to write a script that loops through each day and sets the`created` date filters to the start and end of day. This avoids timeouts and memory issues when syncing large datasets.
142+
143+
##Cleanup
144+
145+
Call`close()` to release database connections when shutting down:
146+
147+
```ts
148+
awaitsync.close()
149+
```

‎packages/sync-engine/src/database/postgres.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,8 @@ export class PostgresClient {
229229
})
230230
returncleansed
231231
}
232+
233+
asyncclose():Promise<void>{
234+
awaitthis.pool.end()
235+
}
232236
}

‎packages/sync-engine/src/stripeSync.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,10 @@ export class StripeSync {
17101710

17111711
returnentities
17121712
}
1713+
1714+
asyncclose():Promise<void>{
1715+
awaitthis.postgresClient.close()
1716+
}
17131717
}
17141718

17151719
functionchunkArray<T>(array:T[],chunkSize:number):T[][]{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp