logging
This commit is contained in:
@@ -11,10 +11,12 @@ from helpers.ruz import ruz
|
||||
|
||||
|
||||
def process():
|
||||
time_now = now()
|
||||
print(time_now)
|
||||
for user in mongo.users_collection.find({"notify_minutes": {"$ne": None}, "hse_id": {"$ne": None}}):
|
||||
for lesson in mongo.lessons_collection.find({
|
||||
"hse_user_id": user["hse_id"],
|
||||
"begin": {"$lte": now() + datetime.timedelta(minutes=user["notify_minutes"])},
|
||||
"begin": {"$lte": time_now + datetime.timedelta(minutes=user["notify_minutes"])},
|
||||
"notified": False
|
||||
}):
|
||||
ans = ""
|
||||
@@ -30,7 +32,6 @@ def process():
|
||||
except ApiTelegramException:
|
||||
pass
|
||||
mongo.lessons_collection.update_one({"_id": lesson['_id']}, {"$set": {"notified": True}})
|
||||
time_now = now()
|
||||
for user in mongo.users_collection.find({"next_daily_notify_time": {"$lte": time_now}}):
|
||||
user_model = UserSchema().load(user)
|
||||
if time_now.weekday() != 6:
|
||||
|
||||
Reference in New Issue
Block a user