diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2019-01-08 20:35:12 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2019-01-08 20:35:12 +0000 |
commit | 5a8e9a81889b2c1520d68fbd1fd5e787a273113b (patch) | |
tree | 9af88b813a7b5bb42725c7d51cf47405a2cdba76 /runprog.py | |
parent | 332ae56f3a241a89dddc920523c156d909aa1d36 (diff) | |
parent | 7937aadec4389bfe96d3d80cfad50312efa2e5d9 (diff) | |
download | SmallYTChannelBot-5a8e9a81889b2c1520d68fbd1fd5e787a273113b.tar.gz SmallYTChannelBot-5a8e9a81889b2c1520d68fbd1fd5e787a273113b.zip |
updated database
Diffstat (limited to 'runprog.py')
-rw-r--r-- | runprog.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/runprog.py b/runprog.py new file mode 100644 index 0000000..4568c59 --- /dev/null +++ b/runprog.py @@ -0,0 +1,23 @@ +from time import sleep +import subprocess +import multiprocessing + +def thread_(): + subprocess.run(["python3", "SmallYTChannelBotSubmissions.py"]) + +while True: + thread = multiprocessing.Process(target = thread_, args = ()) + thread.start() + + sleep(60 * 60 * 2) + + print("closing...") + file = open("pid.txt", "r") + pid = file.readlines()[0] + file.close() + + subprocess.run(["kill", pid]) + thread.terminate() + + print("killed ", pid) + |