Skip to content

Commit

Permalink
fix return types
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Dec 20, 2024
1 parent 0f395b2 commit b255828
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server/vmWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ app.post('/assignVM', async (req, res) => {
return res.json(vm);
}
}
return res.json(null);
res.json(null);
} catch (e) {
console.warn(e);
return res.status(500).end();
res.status(500).end();
}
});

Expand All @@ -53,10 +53,10 @@ app.post('/releaseVM', async (req, res) => {
if (req.body.id) {
await pool?.resetVM(req.body.id, req.body.roomId);
}
return res.end();
res.end();
} catch (e) {
console.warn(e);
return res.status(500).end();
res.status(500).end();
}
});

Expand All @@ -78,7 +78,7 @@ app.get('/stats', async (req, res) => {
};
}
}
return res.json(vmManagerStats);
res.json(vmManagerStats);
});

app.get('/isFreePoolFull', async (req, res) => {
Expand Down Expand Up @@ -106,13 +106,13 @@ app.get('/isFreePoolFull', async (req, res) => {
}),
);
const isFull = fullResult.every(Boolean);
return res.json({ isFull });
res.json({ isFull });
});

app.post('/updateSnapshot', async (req, res) => {
const pool = vmManagers[req.body.provider + req.body.region];
const result = await pool?.updateSnapshot();
return res.send(result?.toString() + '\n');
res.send(result?.toString() + '\n');
});

app.listen(config.VMWORKER_PORT, () => {
Expand Down

0 comments on commit b255828

Please sign in to comment.