Skip to content

Commit

Permalink
add workdir cleanup job
Browse files Browse the repository at this point in the history
  • Loading branch information
aperrin66 committed Nov 18, 2024
1 parent 5d0d534 commit 6adbcbe
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
24 changes: 24 additions & 0 deletions geospaas_rest_api/migrations/0007_workdircleanupjob.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 3.2 on 2024-11-18 08:27

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('geospaas_rest_api', '0006_syntoolcomparejob'),
]

operations = [
migrations.CreateModel(
name='WorkdirCleanupJob',
fields=[
],
options={
'proxy': True,
'indexes': [],
'constraints': [],
},
bases=('geospaas_rest_api.job',),
),
]
3 changes: 2 additions & 1 deletion geospaas_rest_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
ConvertJob,
SyntoolCleanupJob,
SyntoolCompareJob,
HarvestJob)
HarvestJob,
WorkdirCleanupJob)
18 changes: 18 additions & 0 deletions geospaas_rest_api/processing_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,21 @@ def check_parameters(parameters):
@staticmethod
def make_task_parameters(parameters):
return ((parameters['search_config_dict'],), {})


class WorkdirCleanupJob(Job):
"""Remove everything in the working directory"""
class Meta:
proxy = True

@classmethod
def get_signature(cls, parameters):
return tasks_core.cleanup_workdir.signature()

@staticmethod
def check_parameters(parameters):
return parameters

@staticmethod
def make_task_parameters(parameters):
return (tuple(), {})

0 comments on commit 6adbcbe

Please sign in to comment.