1234567891011121314151617181920212223 |
- from time import time
- from uuid import uuid1
- from pycs.database.Project import Project
- class Job:
- """
- wrapper class to track job data and progress
- """
- # pylint: disable=too-few-public-methods
- def __init__(self, project: Project, job_type: str, name: str):
- self.uuid = self.identifier = str(uuid1())
- self.project_id = project.id
- self.type = job_type
- self.name = name
- self.exception = None
- self.progress = 0
- self.created = int(time())
- self.updated = int(time())
- self.started = None
- self.finished = None
|