fix: write the cron config after the app.json has been deleted

Without this, we try to write the config for the app even though it doesn't exist anymore, causing issues with deleting apps with invalid cron configs.
This commit is contained in:
Jose Diaz-Gonzalez committed 2025-06-19 01:09:15 -04:00
1 parent 6f0039ebf1
commit 776013b0f4
3 files changed
+6 -10

No files matched your search

+5 -6
View File
@@ -55,19 +55,18 @@ func TriggerPostAppRenameSetup(oldAppName string, newAppName string) error {
return nil
}
// TriggerPreDelete stops cron for a given app
func TriggerPreDelete(appName string) error {
// TriggerPostDelete destroys the cron property for a given app container
func TriggerPostDelete(appName string) error {
scheduler := common.GetAppScheduler(appName)
_, err := common.CallPlugnTrigger(common.PlugnTriggerInput{
Trigger: "scheduler-cron-write",
Args: []string{scheduler, appName},
StreamStdio: true,
})
return err
}
if err != nil {
return err
}
// TriggerPostDelete destroys the cron property for a given app container
func TriggerPostDelete(appName string) error {
if err := common.PropertyDestroy("cron", appName); err != nil {
return err
}