fix handleResponse responding with proxmox task status
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
4f654f5dcf
commit
3f98355d32
2
pve.js
2
pve.js
@ -35,7 +35,7 @@ export async function requestPVE(path, method, cookies, body = null, token = nul
|
|||||||
|
|
||||||
export async function handleResponse(node, result, res) {
|
export async function handleResponse(node, result, res) {
|
||||||
const waitFor = delay => new Promise(resolve => setTimeout(resolve, delay));
|
const waitFor = delay => new Promise(resolve => setTimeout(resolve, delay));
|
||||||
if (result.data.data && typeof(result.data.data) === String && result.data.data.startsWith("UPID:")) {
|
if (result.data.data && typeof(result.data.data) === "string" && result.data.data.startsWith("UPID:")) {
|
||||||
let upid = result.data.data;
|
let upid = result.data.data;
|
||||||
while (true) {
|
while (true) {
|
||||||
let taskStatus = await requestPVE(`/nodes/${node}/tasks/${upid}/status`, "GET", null, null, pveAPIToken);
|
let taskStatus = await requestPVE(`/nodes/${node}/tasks/${upid}/status`, "GET", null, null, pveAPIToken);
|
||||||
|
Loading…
Reference in New Issue
Block a user