Skip to content

Commit

Permalink
fix(serverless): properly remove Cron functions (#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuiiBz authored Jul 16, 2023
1 parent 8db1289 commit 0fb1f28
Show file tree
Hide file tree
Showing 3 changed files with 1,559 additions and 2,555 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-plums-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lagon/serverless': patch
---

Properly remove Cron functions
8 changes: 2 additions & 6 deletions crates/serverless/src/deployments/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,9 @@ where
)
.await;

if deployment.should_run_cron() {
let mut cronjob = cronjob.lock().await;
let mut cronjob = cronjob.lock().await;

if let Err(error) = cronjob.remove(&deployment.id).await {
error!(deployment = deployment.id; "Failed to remove cron: {}", error);
}
}
cronjob.remove(&deployment.id).await.unwrap_or(());
}
Err(error) => {
increment_counter!(
Expand Down
Loading

3 comments on commit 0fb1f28

@vercel
Copy link

@vercel vercel bot commented on 0fb1f28 Jul 16, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

www – ./www

www-lagon.vercel.app
lagon.dev
www-git-main-lagon.vercel.app
lagon.app

@vercel
Copy link

@vercel vercel bot commented on 0fb1f28 Jul 16, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

docs – ./packages/docs

docs-git-main-lagon.vercel.app
lagon-docs.vercel.app
docs.lagon.app
docs-lagon.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 0fb1f28 Jul 16, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

storybook – ./packages/ui

storybook-lagon.vercel.app
storybook-swart-eight.vercel.app
storybook-git-main-lagon.vercel.app
ui.lagon.app

Please sign in to comment.