sync & copy api error on missing jobId

This commit is contained in:
FTCHD
2025-02-28 15:50:44 +02:00
parent 0335950345
commit 8d031754d4
+6 -42
View File
@@ -402,28 +402,10 @@ export async function startCopy({
}).then((res) => res.json() as Promise<{ jobid: string }>)
console.log('Copy operation started:', r)
return
// if (!r.jobid) {
// throw new Error("Failed to start copy job");
// }
// Monitor job status
// while (true) {
// const status = await fetch(
// `http://localhost:5572/job/status/${r.jobid}`,
// {
// method: "POST",
// },
// ).then((res) => res.json() as Promise<RcloneJobStatus>);
// if (status.finished) {
// return status.success;
// }
// // Wait a bit before checking again
// await new Promise((resolve) => setTimeout(resolve, 1000));
// }
if (!r.jobid) {
throw new Error('Failed to start copy job')
}
}
export async function startSync({
@@ -461,28 +443,10 @@ export async function startSync({
}).then((res) => res.json() as Promise<{ jobid: string }>)
console.log('Sync operation started:', r)
return
// if (!r.jobid) {
// throw new Error("Failed to start copy job");
// }
// Monitor job status
// while (true) {
// const status = await fetch(
// `http://localhost:5572/job/status/${r.jobid}`,
// {
// method: "POST",
// },
// ).then((res) => res.json() as Promise<RcloneJobStatus>);
// if (status.finished) {
// return status.success;
// }
// // Wait a bit before checking again
// await new Promise((resolve) => setTimeout(resolve, 1000));
// }
if (!r.jobid) {
throw new Error('Failed to start sync job')
}
}
/* FLAGS */