print "inum:" + str(inum) + "bscsrec:" + str(status.getBSCSRecording()) + "terec:" + str(status.getTERecording())
#if inum+status.getBSCSRecording()+status.getTERecording() < 2:
+ encodenum=0
+ b25num=0
update = chdb.update()
print update
if len(update) > 0:
sys.exit()
elif task["type"] == recdb.REC_TS_DECODE_QUE:
if dt < 10 * 60:
- if status.getB25Decoding() < 2:
- pid = os.fork()
- if pid != 0:#親プロセスの場合
- ""
- else:
+ b25num=b25num+1
+ pid = os.fork()
+ if pid != 0:#親プロセスの場合
+ ""
+ else:
+ if b25num>1:
+ time.sleep(5*b25num)
+ if status.getB25Decoding() < 2:
pin = recpath + "/" + title
recdb.del_reckey(recdb.REC_TS_DECODE_QUE, title, chtxt, btime)
recdb.rec_reckey(recdb.REC_TS_DECODING, title, chtxt, btime, etime, opt)
if checker.checkB25Decode(recpath + "/" + title + ".ts.b25", recpath + "/" + title + ".ts") == 1:
os.remove(recpath + "/" + title + ".ts.b25")
sys.exit()
- else:
- recdb.del_reckey(recdb.REC_TS_DECODE_QUE, title, chtxt, btime)
- bt = bt + datetime.timedelta(seconds=600)
- et = et + datetime.timedelta(seconds=600)
- btime = bt.strftime("%Y-%m-%d %H:%M:%S")
- etime = et.strftime("%Y-%m-%d %H:%M:%S")
- recdb.rec_reckey(recdb.REC_TS_DECODE_QUE, title, chtxt, btime, etime, opt)
+ else:
+ recdb.del_reckey(recdb.REC_TS_DECODE_QUE, title, chtxt, btime)
+ bt = bt + datetime.timedelta(seconds=600)
+ et = et + datetime.timedelta(seconds=600)
+ btime = bt.strftime("%Y-%m-%d %H:%M:%S")
+ etime = et.strftime("%Y-%m-%d %H:%M:%S")
+ recdb.rec_reckey(recdb.REC_TS_DECODE_QUE, title, chtxt, btime, etime, opt)
+ sys.exit()
elif task["type"] == recdb.REC_ENCODE_QUE:
if dt < 10 * 60:
- if status.getEncoding() < int(configreader.getenv("enc_max")):
- pid = os.fork()
- if pid > 0:#親プロセスの場合
- ""
- else:
+ encodenum=encodenum+1
+ pid = os.fork()
+ if pid > 0:#親プロセスの場合
+ ""
+ else:
+ if encodenum>1:
+ time.sleep(5*encodenum)
+ if status.getEncoding() < int(configreader.getenv("enc_max")):
print opt
pin = recpath + "/" + title + ".ts"
if re.search("d", opt):
recdb.del_reckey(recdb.REC_ENCODE_LOCAL, title, chtxt, btime)
recdb.rec_reckey(recdb.REC_FIN_LOCAL, title, chtxt, btime, etime, opt)
sys.exit()
- else:
- recdb.del_reckey(recdb.REC_ENCODE_QUE, title, chtxt, btime)
- bt = bt + datetime.timedelta(seconds=600)
- et = et + datetime.timedelta(seconds=600)
- btime = bt.strftime("%Y-%m-%d %H:%M:%S")
- etime = et.strftime("%Y-%m-%d %H:%M:%S")
- recdb.rec_reckey(recdb.REC_ENCODE_QUE, title, chtxt, btime, etime, opt)
+ else:
+ recdb.del_reckey(recdb.REC_ENCODE_QUE, title, chtxt, btime)
+ bt = bt + datetime.timedelta(seconds=600)
+ et = et + datetime.timedelta(seconds=600)
+ btime = bt.strftime("%Y-%m-%d %H:%M:%S")
+ etime = et.strftime("%Y-%m-%d %H:%M:%S")
+ recdb.rec_reckey(recdb.REC_ENCODE_QUE, title, chtxt, btime, etime, opt)
+ sys.exit()
sys.exit()
\ No newline at end of file