Skip to content

Commit

Permalink
Merge pull request #571 from kubeshop/f1ames/fix/synchronizer-timeouts
Browse files Browse the repository at this point in the history
fix(synchronizer): use explicit timeouts for API and auth queries
  • Loading branch information
f1ames authored Nov 23, 2023
2 parents ae4b86b + 3bbb688 commit 077a5e9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-badgers-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@monokle/synchronizer": patch
---

Add explicit timeouts for API communication
1 change: 1 addition & 0 deletions packages/synchronizer/src/handlers/apiHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export class ApiHandler {
query,
variables,
}),
timeout: 30 * 1000,
});
}

Expand Down
8 changes: 6 additions & 2 deletions packages/synchronizer/src/handlers/deviceFlowHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Issuer} from 'openid-client';
import {Issuer, custom} from 'openid-client';
import {
DEFAULT_DEVICE_FLOW_IDP_URL,
DEFAULT_DEVICE_FLOW_CLIENT_ID,
Expand Down Expand Up @@ -28,7 +28,11 @@ export class DeviceFlowHandler {
id_token_signed_response_alg: DEFAULT_DEVICE_FLOW_ALG,
},
private _clientScope: string = DEFAULT_DEVICE_FLOW_CLIENT_SCOPE
) {}
) {
custom.setHttpOptionsDefaults({
timeout: 10 * 1000,
});
}

async initializeAuthFlow(): Promise<DeviceFlowHandle> {
const client = await this.getClient();
Expand Down

0 comments on commit 077a5e9

Please sign in to comment.