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

Less eager error dialog #237

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/clusters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,17 @@ export class DaskClusterManager extends Widget {
this._serverSettings
);
if (response.status !== 200) {
this._failedServerChecks++;
const msg =
'Failed to list clusters: might the server extension not be installed/enabled?';
'Failed to list Dask clusters: might the server extension not be installed/enabled?';
const err = new Error(msg);
if (!this._serverErrorShown) {
if (!this._hasServer && this._failedServerChecks == 5) {
void showErrorMessage('Dask Server Error', err);
this._serverErrorShown = true;
}
throw err;
}
this._hasServer = true;

const data = (await response.json()) as IClusterModel[];
this._clusters = data;

Expand Down Expand Up @@ -573,7 +575,8 @@ export class DaskClusterManager extends Widget {
this,
IChangedArgs<IClusterModel | undefined>
>(this);
private _serverErrorShown = false;
private _failedServerChecks = 0;
private _hasServer = false;
private _isReady = true;
private _registry: CommandRegistry;
private _launchClusterId: string;
Expand Down