Commit ca4d3423 authored by Julian Rother's avatar Julian Rother

Moved the first job ping to the earliest point possible

parent 1513ea4a
......@@ -74,11 +74,11 @@ int main(int argc, char *argv[])
init_avlogbuf();
jobid = atoi(argv[1]);
ping_job(jobid, "running", 0);
if (!strcmp(argv[2], "probe-raw"))
path = buildpath(getenv(WORKER_RAW), jstr(jlookup(argv[4], "path"), 0));
else
path = buildpath(getenv(WORKER_RELEASED), jstr(jlookup(argv[4], "path"), 0));
ping_job(jobid, "running", 0);
opts = 0;
av_dict_set_int(&opts, "export_xmp", 1, 0); /* Ignored if not supported */
......
......@@ -13,10 +13,10 @@ int main(int argc, char *argv[])
init_env();
init_avlogbuf();
jobid = atoi(argv[1]);
ping_job(jobid, "running", 0);
src = buildpath(getenv(WORKER_TMP), jstr(jlookup(argv[4], "source"), 0));
dest = buildpath(getenv(WORKER_RELEASED), jstr(jlookup(argv[4], "path"), 0));
destdir = dirname(mprintf("%s/%s", getenv(WORKER_RELEASED), jstr(jlookup(argv[4], "path"), "")));
ping_job(jobid, "running", 0);
overwrite_check(dest, 0, 0);
if (mkdir(destdir, 02775) && errno != EEXIST)
job_failed("Could not create target directory \"%s\": %s", destdir, strerror(errno));
......
......@@ -21,11 +21,11 @@ int main(int argc, char *argv[])
av_init_packet(&pkt);
jobid = atoi(argv[1]);
ping_job(jobid, "running", 0);
path = buildpath(getenv(WORKER_RELEASED), jstr(jlookup(argv[4], "path"), 0));
srcpath = buildpath(getenv(WORKER_RAW), jstr(jlookup(argv[4], "srcpath"), 0));
tmp = mprintf("%s/.tmp-%i", getenv(WORKER_TMP), jobid);
overwrite_check(path, srcpath, jstr(jlookup(argv[4], "srchash"), ""));
ping_job(jobid, "running", 0);
demux = 0;
if (err = avformat_open_input(&demux, path, 0, 0))
......
......@@ -37,11 +37,11 @@ int main(int argc, char *argv[])
/* Prepare arguments */
jobid = atoi(argv[1]);
ping_job(jobid, "running", 0);
src = buildpath(getenv(WORKER_RELEASED), jstr(jlookup(argv[4], "path"), 0));
tmp = mprintf("%s/.tmp-%i", getenv(WORKER_TMP), jobid);
dest = mprintf("%s/thumbnail/l_%s.jpg", getenv(WORKER_RELEASED),
jstr(jlookup(argv[4], "lectureid"), "0"));
ping_job(jobid, "running", 0);
/* Open src */
demux = 0;
......
......@@ -269,6 +269,7 @@ int main(int argc, char *argv[])
return 99;
jobid = atoi(argv[1]);
ping_job(jobid, "running", 0);
input = jlookup(argv[4], "input");
inpath = buildpath(getenv(WORKER_RAW), jstr(jlookup(input, "path"), 0));
output = jlookup(argv[4], "output");
......@@ -321,8 +322,8 @@ int main(int argc, char *argv[])
assert_empty_opts(opts);
progress = 0;
ping_job(jobid, "running", 0);
ping_job(jobid, "running", 0);
while (!av_read_frame(demux, &pkt))
{
i = pkt.stream_index;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment