mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-12 18:32:44 +00:00
fix: add missing await
This commit is contained in:
@@ -204,8 +204,13 @@ export default class AnonymizedFile {
|
||||
});
|
||||
}
|
||||
const out = await this.repository.source?.getFileContent(this);
|
||||
this.repository.model.isReseted = false;
|
||||
await this.repository.updateStatus(RepositoryStatus.READY);
|
||||
if (
|
||||
!this.repository.model.isReseted ||
|
||||
this.repository.status != RepositoryStatus.READY
|
||||
) {
|
||||
this.repository.model.isReseted = false;
|
||||
await this.repository.updateStatus(RepositoryStatus.READY);
|
||||
}
|
||||
return out;
|
||||
} finally {
|
||||
span.end();
|
||||
|
||||
@@ -18,7 +18,8 @@ export default class Conference {
|
||||
*/
|
||||
async updateStatus(status: ConferenceStatus, errorMessage?: string) {
|
||||
this._data.status = status;
|
||||
return this._data.save();
|
||||
await this._data.save();
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -173,7 +173,7 @@ export default class PullRequest {
|
||||
async countView() {
|
||||
this._model.lastView = new Date();
|
||||
this._model.pageView = (this._model.pageView || 0) + 1;
|
||||
return this._model.save();
|
||||
await this._model.save();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -185,7 +185,7 @@ export default class PullRequest {
|
||||
this._model.status = status;
|
||||
this._model.statusDate = new Date();
|
||||
this._model.statusMessage = statusMessage;
|
||||
return this._model.save();
|
||||
await this._model.save();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -223,7 +223,7 @@ export default class PullRequest {
|
||||
this._model.pullRequest.mergedDate = undefined;
|
||||
this._model.pullRequest.state = "closed";
|
||||
this._model.pullRequest.draft = false;
|
||||
return Promise.all([this._model.save()]);
|
||||
await this._model.save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -304,7 +304,7 @@ export default class Repository {
|
||||
this._model.lastView = new Date();
|
||||
this._model.pageView = (this._model.pageView || 0) + 1;
|
||||
if (!isConnected) return this.model;
|
||||
return this._model.save();
|
||||
await this._model.save();
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
@@ -328,7 +328,7 @@ export default class Repository {
|
||||
this._model.statusDate = new Date();
|
||||
this._model.statusMessage = statusMessage;
|
||||
if (!isConnected) return this.model;
|
||||
return this._model.save();
|
||||
await this._model.save();
|
||||
} finally {
|
||||
span.end();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,8 @@ router.get(
|
||||
}
|
||||
// cache the file for 5min
|
||||
res.header("Cache-Control", "max-age=300");
|
||||
await Promise.all([repo.countView(), f.send(res)]);
|
||||
await repo.countView();
|
||||
f.send(res);
|
||||
} catch (error) {
|
||||
return handleError(error, res, req);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user