Working
This commit is contained in:
parent
6586ac2bfe
commit
e06c43b762
@ -74,19 +74,16 @@ def update_crontab(p_my_handler):
|
||||
user_ids = []
|
||||
user_crontab = []
|
||||
|
||||
if all_users != None:
|
||||
for element in all_users:
|
||||
if element["cron"] != '' and element["telegram_user_id"] != '': # check if both values are existing so I have consistent data
|
||||
for element in all_users:
|
||||
if element["cron"] != '' and element["telegram_user_id"] != '': # check if both values are existing so I have consistent data
|
||||
try:
|
||||
user_ids.append(int(element["telegram_user_id"]))
|
||||
try:
|
||||
user_ids.append(int(element["telegram_user_id"]))
|
||||
try:
|
||||
user_crontab.append(str(element["cron"]))
|
||||
except:
|
||||
user_ids.pop() # if something goes wrong with cron I have to delete matching user id
|
||||
except: continue
|
||||
else:
|
||||
print("Error with all users from db. Retrying in update_crontab()")
|
||||
update_crontab(p_my_handler)
|
||||
user_crontab.append(str(element["cron"]))
|
||||
except:
|
||||
user_ids.pop() # if something goes wrong with cron I have to delete matching user id
|
||||
except: continue
|
||||
|
||||
|
||||
|
||||
print(user_ids)
|
||||
|
Loading…
Reference in New Issue
Block a user