[mythtv] Need some help understanding jobqueue

Ryan Steffes rbsteffes at gmail.com
Fri Nov 12 14:10:25 UTC 2004


On Thu, 11 Nov 2004 22:20:30 -0500 (EST), Chris Pinkham
<cpinkham at bc2va.org> wrote:
> 
> 
> > I'm fooling around with adding the ability to transcode from mythweb
> > and I've encountered something odd.  I'm inserting jobs as
> > insert into jobqueue (chanid, starttime,inserttime, type,status,
> > hostname)  values( transcode_ID, FROM_UNIXTIME(transcode_starttime]),
> > FROM_UNIXTIME( time() ),1,1,db_host )
> >
> > Which doesn't quite work.  What's happening is the job goes into the
> > database, then it seems to create a duplicate of that job and run it.
> > When it's done, I end up with one job as status 4 (Running) and one
> > job with status 3 (Starting)
> >
> > Like so (non-related entries removed):
> > select id,title,status, comment from jobqueue as j, recorded as r
> > where r.chanid=j.chanid and r.starttime=j.starttime order by j.id;
> > | 899 | Frasier                 |      4 | 70% Completed           |
> > | 909 | Frasier                 |      3 |                         |
> 
> If you have 2 rows with different ids, then it looks like you somehow
> inserted 2 rows.  Can you check to make sure that all other fields
> on those 2 rows are equal (except status and comment)?
> 
> The 2 rows listed are also 10 ids apart which indicates that you did a
> whole bunch of other inserts between the time the 2nd row was inserted
> and when the first one was inserted.  Did you queue up a group of
> transcode jobs or just that one?
> 
> --
> 
> Chris
> 
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> 
> 
> 

I think I figured out what's happening but I'm unsure how to fix it. 
It's going back and picking the first job that matches the job type
and starttime and then using that to update the status.  In this
particular case it was because the original transcoding was still
there.

Would it be preferable then for me to get the old job ID if it exists
and reuse that for the new job by resetting the status?


More information about the mythtv-dev mailing list