feat: add a flag to know if a repo has been reseted

This commit is contained in:
tdurieux
2023-04-03 10:21:56 +02:00
parent ef1a2bfa4a
commit 344ecf2a33
6 changed files with 19 additions and 6 deletions

View File

@@ -122,6 +122,7 @@ export default class GitHubDownload extends GitHubBase implements SourceBase {
clearTimeout(progressTimeout);
}
this.repository.model.isReseted = false;
await this.repository.updateStatus(RepositoryStatus.READY);
}

View File

@@ -59,9 +59,11 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
} else {
content = Buffer.from("");
}
await storage.write(file.originalCachePath, content, file, this);
this.repository.model.isReseted = false;
await this.repository.model.save();
if (this.repository.status !== RepositoryStatus.READY)
await this.repository.updateStatus(RepositoryStatus.READY);
await storage.write(file.originalCachePath, content, file, this);
return stream.Readable.from(content);
} catch (error) {
if ((error as any).status === 404 || (error as any).httpStatus === 404) {