mirror of
https://github.com/FakeTV/pseudo-channel.git
synced 2025-12-22 11:13:28 +00:00
Experienced the duplicate entry error for todays daily_schedule error. Trying something different.
This commit is contained in:
@@ -596,6 +596,10 @@ class PseudoChannel():
|
|||||||
|
|
||||||
logging.info("##### Dropping previous daily_schedule database")
|
logging.info("##### Dropping previous daily_schedule database")
|
||||||
|
|
||||||
|
self.db.remove_all_daily_scheduled_items()
|
||||||
|
|
||||||
|
sleep(1)
|
||||||
|
|
||||||
if self.USING_COMMERCIAL_INJECTION:
|
if self.USING_COMMERCIAL_INJECTION:
|
||||||
self.commercials = PseudoChannelCommercial(
|
self.commercials = PseudoChannelCommercial(
|
||||||
self.db.get_commercials(),
|
self.db.get_commercials(),
|
||||||
@@ -764,8 +768,6 @@ class PseudoChannel():
|
|||||||
|
|
||||||
previous_episode = None
|
previous_episode = None
|
||||||
|
|
||||||
self.db.remove_all_daily_scheduled_items()
|
|
||||||
|
|
||||||
for entry in self.MEDIA:
|
for entry in self.MEDIA:
|
||||||
|
|
||||||
#print entry.natural_end_time
|
#print entry.natural_end_time
|
||||||
|
|||||||
22
startstop.sh
22
startstop.sh
@@ -3,7 +3,7 @@
|
|||||||
# file: startstop.sh
|
# file: startstop.sh
|
||||||
|
|
||||||
#----
|
#----
|
||||||
# Simple script to start / stop PseudoChannel.py
|
# Simple script to start / stop a python script in the background.
|
||||||
#----
|
#----
|
||||||
|
|
||||||
#----
|
#----
|
||||||
@@ -26,12 +26,14 @@ VIRTUAL_ENV_DIR="env"
|
|||||||
|
|
||||||
#----END EDITABLE VARS-------
|
#----END EDITABLE VARS-------
|
||||||
|
|
||||||
|
# If virtualenv specified & exists, using that version of python instead.
|
||||||
if [ -d "$VIRTUAL_ENV_DIR" ]; then
|
if [ -d "$VIRTUAL_ENV_DIR" ]; then
|
||||||
|
|
||||||
PYTHON_TO_USE="$VIRTUAL_ENV_DIR/bin/python"
|
PYTHON_TO_USE="$VIRTUAL_ENV_DIR/bin/python"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If the .pid file doesn't exist (let's assume no processes are running)...
|
||||||
if [ ! -e "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE" ]; then
|
if [ ! -e "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE" ]; then
|
||||||
|
|
||||||
# If the running.pid file doesn't exists, create it, start PseudoChannel.py and add the PID to it.
|
# If the running.pid file doesn't exists, create it, start PseudoChannel.py and add the PID to it.
|
||||||
@@ -54,6 +56,8 @@ else
|
|||||||
|
|
||||||
kill "$the_pid"
|
kill "$the_pid"
|
||||||
|
|
||||||
|
COUNTER=1
|
||||||
|
|
||||||
while [ -e /proc/$the_pid ]
|
while [ -e /proc/$the_pid ]
|
||||||
|
|
||||||
do
|
do
|
||||||
@@ -62,8 +66,24 @@ else
|
|||||||
|
|
||||||
sleep .7
|
sleep .7
|
||||||
|
|
||||||
|
COUNTER=$[$COUNTER +1]
|
||||||
|
|
||||||
|
if [ $COUNTER -eq 20 ]; then
|
||||||
|
|
||||||
|
kill -9 "$the_pid"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $COUNTER -eq 40 ]; then
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS @: $the_pid has finished"
|
echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS @: $the_pid has finished"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
Reference in New Issue
Block a user