Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
68b173c9
Verified
Commit
68b173c9
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Add default schedules to check_data and PDF expiry
parent
27929007
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!939
More default schedules
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/core/data_checks.py
+2
-1
2 additions, 1 deletion
aleksis/core/data_checks.py
aleksis/core/util/pdf.py
+2
-1
2 additions, 1 deletion
aleksis/core/util/pdf.py
with
4 additions
and
2 deletions
aleksis/core/data_checks.py
+
2
−
1
View file @
68b173c9
import
logging
from
datetime
import
timedelta
from
django.apps
import
apps
from
django.contrib.contenttypes.models
import
ContentType
...
...
@@ -236,7 +237,7 @@ class DataCheckRegistry:
return
[(
check
.
name
,
check
.
verbose_name
)
for
check
in
cls
.
data_checks
]
@recorded_task
@recorded_task
(
run_every
=
timedelta
(
minutes
=
15
))
def
check_data
(
recorder
:
ProgressRecorder
):
"""
Execute all registered data checks and send email if activated.
"""
for
check
in
recorder
.
iterate
(
DataCheckRegistry
.
data_checks
):
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/util/pdf.py
+
2
−
1
View file @
68b173c9
import
os
import
subprocess
# noqa
from
datetime
import
timedelta
from
tempfile
import
TemporaryDirectory
from
typing
import
Optional
,
Tuple
,
Union
from
urllib.parse
import
urljoin
...
...
@@ -129,7 +130,7 @@ def clean_up_expired_pdf_files() -> None:
PDFFile
.
objects
.
filter
(
expires_at__lt
=
timezone
.
now
()).
delete
()
@app.task
@app.task
(
run_every
=
timedelta
(
days
=
1
))
def
clean_up_expired_pdf_files_task
()
->
None
:
"""
Clean up expired PDF files.
"""
return
clean_up_expired_pdf_files
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment