Skip to content

add cronjob that clears old tasks every midnight - #3066

Merged
bjester merged 6 commits into
learningequality:unstablefrom
aronasorman:clear-old-tasks-cronjob
Aug 5, 2021
Merged

add cronjob that clears old tasks every midnight#3066
bjester merged 6 commits into
learningequality:unstablefrom
aronasorman:clear-old-tasks-cronjob

Conversation

@aronasorman

Copy link
Copy Markdown
Collaborator

Summary

Description of the change(s) you made

Create a cronjob that spawns a pod that clears tasks older than 7 days.

Manual verification steps performed

  1. Create cronjob on my local machine that connects to develop
  2. Run that cronjob manually
  3. Check that there are no jobs older than 7 days

Reviewer's Checklist

This section is for reviewers to fill out.

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

Comment threadk8s/templates/clear-old-tasks-cronjob.yaml Outdated
@codecov

codecovBot commented Apr 5, 2021

Copy link
Copy Markdown

Codecov Report

Merging #3066 (6f66823) into unstable (9264221) will decrease coverage by 0.18%.
The diff coverage is n/a.

❗ Current head 6f66823 differs from pull request most recent head 7acb364. Consider uploading reports for the commit 7acb364 to get more accurate results
Impacted file tree graph

@@ Coverage Diff @@## unstable #3066 +/- ##
============================================
- Coverage 86.12% 85.93% -0.19% 
============================================
Files 305 304 -1 Lines 16459 16403 -56 ============================================
- Hits 14175 14096 -79 - Misses 2284 2307 +23 
Impacted FilesCoverage Δ
...tentcuration/contentcuration/utils/celery/tasks.py76.27% <0.00%> (-5.99%)⬇️
contentcuration/contentcuration/tasks.py57.62% <0.00%> (-3.96%)⬇️
contentcuration/contentcuration/tasks_test.py83.33% <0.00%> (-2.04%)⬇️
contentcuration/contentcuration/models.py84.58% <0.00%> (-1.98%)⬇️
...ion/contentcuration/tests/viewsets/test_channel.py92.91% <0.00%> (-1.27%)⬇️
...ntcuration/contentcuration/tests/test_asynctask.py91.42% <0.00%> (-1.08%)⬇️
contentcuration/contentcuration/views/base.py62.82% <0.00%> (-0.62%)⬇️
...ontentcuration/contentcuration/viewsets/channel.py79.74% <0.00%> (-0.43%)⬇️
contentcuration/contentcuration/views/internal.py85.37% <0.00%> (-0.23%)⬇️
...contentcuration/tests/views/test_views_internal.py97.24% <0.00%> (-0.21%)⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d302bcd...7acb364. Read the comment docs.

@rtibbles
rtibblesforce-pushed the clear-old-tasks-cronjob branch from 6f66823 to 73d5532CompareAugust 4, 2021 23:33
@rtibbles
rtibbles changed the base branch from hotfixes to unstableAugust 4, 2021 23:34
@rtibbles
rtibblesforce-pushed the clear-old-tasks-cronjob branch from 9a327cb to 90e32e7CompareAugust 5, 2021 02:33
Comment threadk8s/templates/garbage-collect-cronjob.yaml Outdated
@aronasorman

Copy link
Copy Markdown
CollaboratorAuthor

The kubernetes part looks good to me!

@bjesterbjester left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This appears to introduce a regression. After publishing, the PUBLISH button is enabled.

rtibblesand others added 2 commits August 5, 2021 15:04
Co-authored-by: Richard Tibbles <richard@learningequality.org>
@rtibbles
rtibblesforce-pushed the clear-old-tasks-cronjob branch from edaf3b4 to 7acb364CompareAugust 5, 2021 22:04
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed! Quality Gate passed

BugA0 Bugs
VulnerabilityA0 Vulnerabilities
Security HotspotA0 Security Hotspots
Code SmellA1 Code Smell

No Coverage information No Coverage information
No Duplication information No Duplication information

@bjesterbjester left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Publishing issue appears resolved by #3256

@bjester
bjester merged commit 8c4cf8e into learningequality:unstableAug 5, 2021
Sign up for freeto 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.

3 participants

@aronasorman@bjester@rtibbles