mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-28 23:25:21 +01:00
add repository status page
This commit is contained in:
1 parent
fcdaf69b6a
commit
22465d455c
7 files changed
+193
-14
No files matched your search
@@ -51,6 +51,7 @@ module.exports.downloadRepoAndAnonymize = async (repoConfig) => {
|
||||
return true;
|
||||
} else if (repoConfig.options.mode == "stream") {
|
||||
// in stream mode only download the list of file from github
|
||||
await repoUtils.updateStatus(repoConfig, "downloading");
|
||||
await fileUtils.getFileList({ repoConfig });
|
||||
await repoUtils.updateStatus(repoConfig, "ready");
|
||||
return true;
|
||||
|
||||
+10
-2
@@ -139,11 +139,19 @@ module.exports.downloadRepoZip = async (repoConfig, target) => {
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.updateStatus = async (repoConfig, status) => {
|
||||
module.exports.updateStatus = async (repoConfig, status, errorMessage) => {
|
||||
repoConfig.status = status;
|
||||
repoConfig.errorMessage = errorMessage;
|
||||
const update = { $set: { status } };
|
||||
if (!errorMessage) {
|
||||
update["$unset"] = { errorMessage: "" };
|
||||
} else {
|
||||
update["$set"].errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
await db
|
||||
.get("anonymized_repositories")
|
||||
.updateOne({ repoId: repoConfig.repoId }, { $set: { status } });
|
||||
.updateOne({ repoId: repoConfig.repoId }, update);
|
||||
};
|
||||
|
||||
module.exports.downloadOriginalRepo = async (repoConfig, destination) => {
|
||||
|
||||
Reference in new issue
Block a user