Skip to content

Fix: Cronjob handling when spider is deleted#289

Merged
erick-GeGe merged 1 commit into
mainfrom
fix/cronjob-spider-deleted-handling
May 27, 2026
Merged

Fix: Cronjob handling when spider is deleted#289
erick-GeGe merged 1 commit into
mainfrom
fix/cronjob-spider-deleted-handling

Conversation

@erick-GeGe

@erick-GeGe erick-GeGe commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Cronjobs are now automatically disabled when their spider is removed in a deploy. A Django signal on Spider.post_save detects the deleted=True transition and disables all active cronjobs for that spider (both SpiderCronJob.status and PeriodicTask.enabled).
  • Orphaned cronjobs (whose spider was deleted) can now be managed from the UI — disabled, edited, or deleted. Previously the API returned 404 for any action on them.
  • Attempting to re-enable a cronjob whose spider no longer exists now returns a clear error message instead of silently failing.
  • Historical spider jobs from deleted spiders are now visible in the cronjob detail page.
  • Fixed a silent failure in disable_cronjob / enable_cronjob where an inconsistent PeriodicTask state would cause the operation to silently do nothing.

Issue

  • Github Issue ID.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • My code follows the style guidelines of this project.
  • I have made corresponding changes to the documentation.
  • New and existing tests pass locally with my changes.
  • If this change is a core feature, I have added thorough tests.
  • If this change affects or depends on the behavior of other estela repositories, I have created pull requests with the relevant changes in the affected repositories. Please, refer to our official documentation.
  • I understand that my pull request may be closed if it becomes obvious or I did not perform all of the steps above.

@erick-GeGe erick-GeGe merged commit 8c45630 into main May 27, 2026
1 check passed
@erick-GeGe erick-GeGe deleted the fix/cronjob-spider-deleted-handling branch May 27, 2026 15:47
@erick-GeGe erick-GeGe restored the fix/cronjob-spider-deleted-handling branch May 28, 2026 21:54
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.

2 participants