Exemplo n.º 1
0
 def generate_fixture_build_job(self, ended_at, playlist_id=None):
     if playlist_id is None:
         playlist_id = self.playlist.id
     self.build_job = BuildJob.create(status="succeeded",
                                      job_type="movie",
                                      ended_at=ended_at,
                                      playlist_id=playlist_id)
     return self.build_job.serialize()
Exemplo n.º 2
0
def start_build_job(playlist):
    """
    clients that a new job is running.
    Register in database that a new build is running. Emits an event to notify
    """
    job = BuildJob.create(status="running",
                          job_type="movie",
                          playlist_id=playlist["id"])
    events.emit("build-job:new", {
        "build_job_id": str(job.id),
        "playlist_id": playlist["id"],
        "created_at": fields.serialize_value(job.created_at),
    },
                project_id=playlist["project_id"])
    return job.serialize()