Skip to content

Commit de00a58

Browse files
committed
refactor server options in DB controller
1 parent d4ea5ea commit de00a58

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Controllers/DatabaseController.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,16 @@ class DatabaseController {
365365
schemaPromise: ?Promise<SchemaController.SchemaController>;
366366
_transactionalSession: ?any;
367367
options: ParseServerOptions;
368+
idempotencyOptions: any;
368369

369370
constructor(adapter: StorageAdapter, options: ParseServerOptions) {
370371
this.adapter = adapter;
372+
this.options = options || {};
373+
this.idempotencyOptions = options.idempotencyOptions || {};
371374
// Prevent mutable this.schema, otherwise one request could use
372375
// multiple schemas, so instead use loadSchema to get a schema.
373376
this.schemaPromise = null;
374377
this._transactionalSession = null;
375-
this.options = options;
376378
}
377379

378380
collectionExists(className: string): Promise<boolean> {
@@ -1734,7 +1736,7 @@ class DatabaseController {
17341736
ttl: 0,
17351737
};
17361738
} else if (isPostgresAdapter) {
1737-
options = (this.options || {}).idempotencyOptions || {};
1739+
options = this.idempotencyOptions;
17381740
options.setIdempotencyFunction = true;
17391741
}
17401742
await this.adapter

0 commit comments

Comments
 (0)