mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 10:52:53 +00:00
fix: fix repository status
This commit is contained in:
@@ -49,9 +49,11 @@ export default class GitHubDownload extends GitHubBase implements SourceBase {
|
||||
try {
|
||||
response = await this._getZipUrl(config.GITHUB_TOKEN);
|
||||
} catch (error) {
|
||||
await this.repository.resetSate("error");
|
||||
throw new AnonymousError("repo_not_accessible", this.repository);
|
||||
}
|
||||
} else {
|
||||
await this.repository.resetSate("error");
|
||||
throw new AnonymousError("repo_not_accessible", this.repository);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
|
||||
} else {
|
||||
content = Buffer.from("");
|
||||
}
|
||||
if (this.repository.status != "ready")
|
||||
await this.repository.updateStatus("ready");
|
||||
await storage.write(file.originalCachePath, content);
|
||||
return stream.Readable.from(content.toString());
|
||||
} catch (error) {
|
||||
@@ -83,6 +85,7 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
|
||||
recursive: "1",
|
||||
});
|
||||
} catch (error) {
|
||||
await this.repository.resetSate("error");
|
||||
throw new AnonymousError("repo_not_accessible", this.repository);
|
||||
}
|
||||
|
||||
@@ -90,6 +93,8 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
|
||||
if (ghRes.data.truncated) {
|
||||
await this.getTruncatedTree(sha, tree, parentPath);
|
||||
}
|
||||
if (this.repository.status != "ready")
|
||||
await this.repository.updateStatus("ready");
|
||||
return tree;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user