Skip to content

Commit

Permalink
Creates a new operation per schedule
Browse files Browse the repository at this point in the history
When an object schedule is created, it embeds a complete operation
template in its "task" field.
On the first schedule time, it creates an operation from the template.
Until now, this operation was used for each subsequent schedule.
This commit prevent that and creates a new operation per schedule, with
the start date added in its name.
  • Loading branch information
jbaptperez authored and sasirven committed Oct 28, 2024
1 parent 06042d6 commit d7e2d09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/service/app_svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import re
import time
import uuid
from collections import namedtuple
from datetime import datetime, timezone
from importlib import import_module
Expand Down Expand Up @@ -100,6 +101,8 @@ async def run_scheduler(self):
if interval > diff.total_seconds() > 0:
self.log.debug('Pulling %s off the scheduler' % s.id)
sop = copy.deepcopy(s.task)
sop.id = str(uuid.uuid4())
sop.name += f" ({datetime.now(timezone.utc).replace(microsecond=0).isoformat()})"
sop.set_start_details()
await sop.update_operation_agents(self.get_services())
await self._services.get('data_svc').store(sop)
Expand Down

0 comments on commit d7e2d09

Please sign in to comment.