pid file
This commit is contained in:
parent
aa1a142a02
commit
2d82ddda07
@ -1,6 +1,7 @@
|
|||||||
|
pid = '/var/run/bot.pid'
|
||||||
bot_token=''
|
bot_token=''
|
||||||
proxy = 'socks5h://socks:pr0xy@109.234.36.187:1080'
|
proxy = 'socks5h://proxy.addr'
|
||||||
zabbix_api = 'http://127.0.0.1/api_jsonrpc.php'
|
zabbix_api = 'http://127.0.0.1/api_jsonrpc.php'
|
||||||
zabbix_user = 'api'
|
zabbix_user = 'api'
|
||||||
zabbix_pass = 'pass'
|
zabbix_pass = 'pass'
|
||||||
users = ['1234', '5678']
|
users = [1234, 5678]
|
13
main.py
13
main.py
@ -58,10 +58,11 @@ def handle_file(message):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
bot.reply_to(message,e )
|
bot.reply_to(message,e )
|
||||||
|
|
||||||
#while True:
|
try:
|
||||||
# try:
|
pid = str(os.getpid())
|
||||||
# bot.polling(none_stop=True, interval=0, timeout=10)
|
pidfile = open(config.pid, 'w')
|
||||||
# except Exception as e:
|
pidfile.write(pid)
|
||||||
# print(e)
|
pidfile.close()
|
||||||
# time.sleep(15)
|
|
||||||
bot.polling(none_stop=True, interval=0, timeout=10)
|
bot.polling(none_stop=True, interval=0, timeout=10)
|
||||||
|
except:
|
||||||
|
pass
|
Loading…
Reference in New Issue
Block a user