feat: use robot instead of user

This commit is contained in:
karishmas6
2024-10-16 23:52:03 +05:30
parent 78912dedb5
commit 700d302ea4
2 changed files with 37 additions and 19 deletions

View File

@@ -12,7 +12,7 @@ import { requireSignIn } from '../middlewares/auth';
import Robot from '../models/Robot';
import Run from '../models/Run';
import { BinaryOutputService } from '../storage/mino';
import { workflowQueue } from '../worker';
// import { workflowQueue } from '../worker';
export const router = Router();
@@ -282,16 +282,16 @@ router.put('/schedule/:id/', requireSignIn, async (req, res) => {
const runId = uuid();
const userId = req.user.id;
await workflowQueue.add(
'run workflow',
{ id, runId, userId },
{
repeat: {
pattern: cronExpression,
tz: timezone
}
}
);
// await workflowQueue.add(
// 'run workflow',
// { id, runId, userId },
// {
// repeat: {
// pattern: cronExpression,
// tz: timezone
// }
// }
// );
res.status(200).json({
message: 'success',