pid file
This commit is contained in:
parent
aa1a142a02
commit
2d82ddda07
@ -1,6 +1,7 @@
|
||||
pid = '/var/run/bot.pid'
|
||||
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_user = 'api'
|
||||
zabbix_pass = 'pass'
|
||||
users = ['1234', '5678']
|
||||
users = [1234, 5678]
|
15
main.py
15
main.py
@ -58,10 +58,11 @@ def handle_file(message):
|
||||
except Exception as e:
|
||||
bot.reply_to(message,e )
|
||||
|
||||
#while True:
|
||||
# try:
|
||||
# bot.polling(none_stop=True, interval=0, timeout=10)
|
||||
# except Exception as e:
|
||||
# print(e)
|
||||
# time.sleep(15)
|
||||
bot.polling(none_stop=True, interval=0, timeout=10)
|
||||
try:
|
||||
pid = str(os.getpid())
|
||||
pidfile = open(config.pid, 'w')
|
||||
pidfile.write(pid)
|
||||
pidfile.close()
|
||||
bot.polling(none_stop=True, interval=0, timeout=10)
|
||||
except:
|
||||
pass
|
Loading…
Reference in New Issue
Block a user