File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,16 @@ export class PowerSyncDatabase extends AbstractPowerSyncDatabase {
4343
4444 protected generateSyncStreamImplementation (
4545 connector : PowerSyncBackendConnector ,
46- // This is used to pass in options on connection instead of only during db creation
46+ // This is used to pass in options on connection instead of only during database creation
4747 options ?: {
4848 retryDelayMs : number ;
4949 crudUploadThrottleMs : number ;
5050 }
5151 ) : AbstractStreamingSyncImplementation {
5252 const remote = new ReactNativeRemote ( connector ) ;
53+ // Use the options passed in during connect, or fallback to the options set during database creation
54+ const retryDelayMs = options ?. retryDelayMs || this . options . retryDelay ;
55+ const crudUploadThrottleMs = options ?. crudUploadThrottleMs || this . options . crudUploadThrottleMs ;
5356
5457 return new ReactNativeStreamingSyncImplementation ( {
5558 adapter : this . bucketStorageAdapter ,
@@ -58,8 +61,8 @@ export class PowerSyncDatabase extends AbstractPowerSyncDatabase {
5861 await this . waitForReady ( ) ;
5962 await connector . uploadData ( this ) ;
6063 } ,
61- retryDelayMs : options ?. retryDelayMs || this . options . retryDelay ,
62- crudUploadThrottleMs : options ?. crudUploadThrottleMs || this . options . crudUploadThrottleMs ,
64+ retryDelayMs,
65+ crudUploadThrottleMs,
6366 identifier : this . database . name
6467 } ) ;
6568 }
Original file line number Diff line number Diff line change @@ -173,11 +173,14 @@ export class PowerSyncDatabase extends AbstractPowerSyncDatabase {
173173 }
174174 ) : StreamingSyncImplementation {
175175 const remote = new WebRemote ( connector ) ;
176+ // Use the options passed in during connect, or fallback to the options set during database creation
177+ const retryDelayMs = options ?. retryDelayMs || this . options . retryDelay ;
178+ const crudUploadThrottleMs = options ?. crudUploadThrottleMs || this . options . crudUploadThrottleMs ;
176179
177180 const syncOptions : WebStreamingSyncImplementationOptions = {
178181 ...( this . options as { } ) ,
179- retryDelayMs : options ?. retryDelayMs || this . options . retryDelay ,
180- crudUploadThrottleMs : options ?. crudUploadThrottleMs || this . options . crudUploadThrottleMs ,
182+ retryDelayMs,
183+ crudUploadThrottleMs,
181184 flags : this . resolvedFlags ,
182185 adapter : this . bucketStorageAdapter ,
183186 remote,
You can’t perform that action at this time.
0 commit comments