Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 workflow pause monitors #1159

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

🚧 workflow pause monitors #1159

wants to merge 5 commits into from

Conversation

thibaultleouay
Copy link
Member

Pause monitors for free users
Still a WIP

Copy link

vercel bot commented Jan 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
openstatus-web ❌ Failed (Inspect) Jan 13, 2025 7:58pm

Copy link

cloudflare-workers-and-pages bot commented Jan 13, 2025

Deploying openstatus-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: cae2930
Status: ✅  Deploy successful!
Preview URL: https://ada21447.openstatus-1sy.pages.dev
Branch Preview URL: https://workflow-monitor.openstatus-1sy.pages.dev

View logs

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • apps/workflows/package.json: Language not supported
Comments suppressed due to low confidence (3)

apps/workflows/src/cron/monitor.ts:55

  • [nitpick] The variable 'user' is being redeclared within the loop, which could lead to confusion. It should be renamed to avoid ambiguity.
for (const user of users) {

apps/workflows/src/cron/monitor.ts:75

  • The 'CreateTask' function is called without awaiting its result. This could lead to unexpected behavior if the task creation fails or takes longer than expected.
await CreateTask({

apps/workflows/src/cron/monitor.ts:135

  • The 'timestamp' variable is calculated but not used correctly in the 'scheduleTime' object. It should be converted to an integer.
const timestamp = Date.now();

//
// Start workflow -> create task with monitors/start
// add users to workflow Redis
console.log(`user worflow started for ${user.userId}`);
Copy link
Preview

Copilot AI Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log message contains a typo. It should be 'workflow' instead of 'worflow'.

Suggested change
console.log(`user worflow started for ${user.userId}`);
console.log(`user workflow started for ${user.userId}`);

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
client: CloudTasksClient;
step: z.infer<typeof workflowStepSchema>;
}) {
const url = "";
Copy link
Preview

Copilot AI Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'url' variable is declared but not assigned any value, which will cause the task creation to fail.

Suggested change
const url = "";
const url = `${env().API_BASE_URL}/tasks/${step}`;

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant