Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Skip sending message on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
freedomofkeima committed May 21, 2017
1 parent 1df4285 commit 60a11f7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions maidchan/cmds/scheduler_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ def process_user_schedules(redis_client, recipient_id, metadata, current_mt):
))
elif schedule_type == "japanese_lesson_mt" and mt < current_mt:
level = user["kanji_level"].lower()
message = get_japanese_message(
metadata["kanji_{}".format(level)],
metadata["vocabulary"]
)
bot.send_text_message(recipient_id, message)
try:
message = get_japanese_message(
metadata["kanji_{}".format(level)],
metadata["vocabulary"]
)
bot.send_text_message(recipient_id, message)
except Exception:
pass
user["schedules"]["japanese_lesson_mt"] += 86400
redis_client.set_user(recipient_id, user)
logging.info("Japanese scheduler for {} - {} is executed!".format(
Expand Down

0 comments on commit 60a11f7

Please sign in to comment.