Skip to content

Commit

Permalink
fix: scheduler.py: catch empty schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
joschobart committed Sep 23, 2024
1 parent 6286104 commit 4731842
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 54 deletions.
2 changes: 1 addition & 1 deletion fun_with_flags/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def create_app(test_config=None):
# regular job for adding matches to user-db
sched.add_job(scheduler.sensor, "cron", day_of_week="tue", hour=2, minute=2)
# v--- testing ---v
# sched.add_job(scheduler.sensor, "cron", day_of_week="mon-sun", hour=21, minute=40)
# sched.add_job(scheduler.sensor, "cron", day_of_week="mon-sun", hour=22, minute=23)
sched.start()
atexit.register(lambda: sched.shutdown(wait=False))

Expand Down
8 changes: 7 additions & 1 deletion fun_with_flags/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from datetime import datetime, timedelta

import couchdb

from . import api, db, helperf


Expand All @@ -14,7 +16,11 @@ def sensor():

_my_doc_name = _now.strftime("%Y%m%d")

_my_document = _couch[_my_doc_name]
try:
_my_document = _couch[_my_doc_name]
except couchdb.http.ResourceNotFound:
print("No jobs today")
return

for _key in _my_document.keys():
if _key != "_id" and _key != "_rev":
Expand Down
26 changes: 13 additions & 13 deletions fun_with_flags/translations/de/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.0.1\n"
"Report-Msgid-Bugs-To: joschobart\n"
"POT-Creation-Date: 2024-09-09 21:07+0200\n"
"POT-Creation-Date: 2024-09-23 22:26+0200\n"
"PO-Revision-Date: 2024-08-03 11:46+0200\n"
"Last-Translator: joschobart\n"
"Language: de\n"
Expand All @@ -19,47 +19,47 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"

#: fun_with_flags/achievements.py:172
#: fun_with_flags/achievements.py:175
#, python-format
msgid "Rare: %(_prevalence)s"
msgstr "Selten: %(_prevalence)s"

#: fun_with_flags/achievements.py:177
#: fun_with_flags/achievements.py:180
#, python-format
msgid "Uncommon: %(_prevalence)s"
msgstr "Unüblich: %(_prevalence)s"

#: fun_with_flags/achievements.py:181
#: fun_with_flags/achievements.py:184
#, python-format
msgid "Common: %(_prevalence)s"
msgstr "Verbreitet: %(_prevalence)s"

#: fun_with_flags/achievements.py:185
#: fun_with_flags/achievements.py:188
#, python-format
msgid "Usual: %(_prevalence)s"
msgstr "Üblich: %(_prevalence)s"

#: fun_with_flags/achievements.py:218
#: fun_with_flags/achievements.py:221
msgid "Your FwF Neighbors Score Evolution"
msgstr "Entwicklung des FwF Punktestands in deiner Nachbarschaft"

#: fun_with_flags/achievements.py:252
#: fun_with_flags/achievements.py:255
msgid "You"
msgstr "Du"

#: fun_with_flags/achievements.py:262
#: fun_with_flags/achievements.py:265
msgid "Well done!"
msgstr "Gut gemacht!"

#: fun_with_flags/achievements.py:264
#: fun_with_flags/achievements.py:267
msgid "There is still room to improve."
msgstr "Es gibt noch Luft nach oben."

#: fun_with_flags/achievements.py:266
#: fun_with_flags/achievements.py:269
msgid "We can do better!"
msgstr "Das können wir besser!"

#: fun_with_flags/achievements.py:277
#: fun_with_flags/achievements.py:280
#, python-format
msgid ""
" Your score of %(_score)s puts you on position %(_position)s out of "
Expand Down Expand Up @@ -150,11 +150,11 @@ msgstr "Automatisches Fordern wurde erfolgreich gelöscht."
msgid "Settings updated."
msgstr "Einstellungen aktualisiert."

#: fun_with_flags/stripe.py:164
#: fun_with_flags/stripe.py:155
msgid "Payment accepted. You're a FwF Unicorn now!"
msgstr "Zahlung akzeptiert. Du bist jetzt ein FwF-Einhorn!"

#: fun_with_flags/stripe.py:184
#: fun_with_flags/stripe.py:175
msgid "No payment received."
msgstr "Keine Zahlung erhalten."

Expand Down
26 changes: 13 additions & 13 deletions fun_with_flags/translations/fr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.0.1\n"
"Report-Msgid-Bugs-To: Naka57POT-Creation-Date: 2024-07-27 11:49+0200\n"
"POT-Creation-Date: 2024-09-09 21:07+0200\n"
"POT-Creation-Date: 2024-09-23 22:26+0200\n"
"PO-Revision-Date: 2024-08-01 08:23+0200\n"
"Last-Translator: Naka57\n"
"Language: fr\n"
Expand All @@ -19,47 +19,47 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"

#: fun_with_flags/achievements.py:172
#: fun_with_flags/achievements.py:175
#, python-format
msgid "Rare: %(_prevalence)s"
msgstr ""

#: fun_with_flags/achievements.py:177
#: fun_with_flags/achievements.py:180
#, python-format
msgid "Uncommon: %(_prevalence)s"
msgstr ""

#: fun_with_flags/achievements.py:181
#: fun_with_flags/achievements.py:184
#, python-format
msgid "Common: %(_prevalence)s"
msgstr ""

#: fun_with_flags/achievements.py:185
#: fun_with_flags/achievements.py:188
#, python-format
msgid "Usual: %(_prevalence)s"
msgstr ""

#: fun_with_flags/achievements.py:218
#: fun_with_flags/achievements.py:221
msgid "Your FwF Neighbors Score Evolution"
msgstr ""

#: fun_with_flags/achievements.py:252
#: fun_with_flags/achievements.py:255
msgid "You"
msgstr ""

#: fun_with_flags/achievements.py:262
#: fun_with_flags/achievements.py:265
msgid "Well done!"
msgstr ""

#: fun_with_flags/achievements.py:264
#: fun_with_flags/achievements.py:267
msgid "There is still room to improve."
msgstr ""

#: fun_with_flags/achievements.py:266
#: fun_with_flags/achievements.py:269
msgid "We can do better!"
msgstr ""

#: fun_with_flags/achievements.py:277
#: fun_with_flags/achievements.py:280
#, python-format
msgid ""
" Your score of %(_score)s puts you on position %(_position)s out of "
Expand Down Expand Up @@ -146,11 +146,11 @@ msgstr "La programmation du défi est supprimée avec succès."
msgid "Settings updated."
msgstr "Paramètres mis à jour."

#: fun_with_flags/stripe.py:164
#: fun_with_flags/stripe.py:155
msgid "Payment accepted. You're a FwF Unicorn now!"
msgstr "Paiement accepté. Vous êtes une Licorne FwF à présent !"

#: fun_with_flags/stripe.py:184
#: fun_with_flags/stripe.py:175
msgid "No payment received."
msgstr "Aucun paiement reçu."

Expand Down
26 changes: 13 additions & 13 deletions fun_with_flags/translations/ro/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-09-09 21:07+0200\n"
"POT-Creation-Date: 2024-09-23 22:26+0200\n"
"PO-Revision-Date: 2024-07-29 21:31+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: ro\n"
Expand All @@ -19,47 +19,47 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"

#: fun_with_flags/achievements.py:172
#: fun_with_flags/achievements.py:175
#, python-format
msgid "Rare: %(_prevalence)s"
msgstr ""

#: fun_with_flags/achievements.py:177
#: fun_with_flags/achievements.py:180
#, python-format
msgid "Uncommon: %(_prevalence)s"
msgstr ""

#: fun_with_flags/achievements.py:181
#: fun_with_flags/achievements.py:184
#, python-format
msgid "Common: %(_prevalence)s"
msgstr ""

#: fun_with_flags/achievements.py:185
#: fun_with_flags/achievements.py:188
#, python-format
msgid "Usual: %(_prevalence)s"
msgstr ""

#: fun_with_flags/achievements.py:218
#: fun_with_flags/achievements.py:221
msgid "Your FwF Neighbors Score Evolution"
msgstr ""

#: fun_with_flags/achievements.py:252
#: fun_with_flags/achievements.py:255
msgid "You"
msgstr ""

#: fun_with_flags/achievements.py:262
#: fun_with_flags/achievements.py:265
msgid "Well done!"
msgstr ""

#: fun_with_flags/achievements.py:264
#: fun_with_flags/achievements.py:267
msgid "There is still room to improve."
msgstr ""

#: fun_with_flags/achievements.py:266
#: fun_with_flags/achievements.py:269
msgid "We can do better!"
msgstr ""

#: fun_with_flags/achievements.py:277
#: fun_with_flags/achievements.py:280
#, python-format
msgid ""
" Your score of %(_score)s puts you on position %(_position)s out of "
Expand Down Expand Up @@ -143,11 +143,11 @@ msgstr ""
msgid "Settings updated."
msgstr ""

#: fun_with_flags/stripe.py:164
#: fun_with_flags/stripe.py:155
msgid "Payment accepted. You're a FwF Unicorn now!"
msgstr ""

#: fun_with_flags/stripe.py:184
#: fun_with_flags/stripe.py:175
msgid "No payment received."
msgstr ""

Expand Down
26 changes: 13 additions & 13 deletions fun_with_flags/translations/tr/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.0.1\n"
"Report-Msgid-Bugs-To: Kara_Kartallar\n"
"POT-Creation-Date: 2024-09-09 21:07+0200\n"
"POT-Creation-Date: 2024-09-23 22:26+0200\n"
"PO-Revision-Date: 2024-09-02 23:34+0200\n"
"Last-Translator: Kara_Kartallar\n"
"Language: tr\n"
Expand All @@ -19,47 +19,47 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.15.0\n"

#: fun_with_flags/achievements.py:172
#: fun_with_flags/achievements.py:175
#, python-format
msgid "Rare: %(_prevalence)s"
msgstr "Nadir: %(_prevalence)s"

#: fun_with_flags/achievements.py:177
#: fun_with_flags/achievements.py:180
#, python-format
msgid "Uncommon: %(_prevalence)s"
msgstr "Sıra Dışı: %(_prevalence)s"

#: fun_with_flags/achievements.py:181
#: fun_with_flags/achievements.py:184
#, python-format
msgid "Common: %(_prevalence)s"
msgstr "Yaygın: %(_prevalence)s"

#: fun_with_flags/achievements.py:185
#: fun_with_flags/achievements.py:188
#, python-format
msgid "Usual: %(_prevalence)s"
msgstr "Olağan: %(_prevalence)s"

#: fun_with_flags/achievements.py:218
#: fun_with_flags/achievements.py:221
msgid "Your FwF Neighbors Score Evolution"
msgstr "FwF Komşularınızın Skor Gelişimi"

#: fun_with_flags/achievements.py:252
#: fun_with_flags/achievements.py:255
msgid "You"
msgstr "Siz"

#: fun_with_flags/achievements.py:262
#: fun_with_flags/achievements.py:265
msgid "Well done!"
msgstr "Tebrikler!"

#: fun_with_flags/achievements.py:264
#: fun_with_flags/achievements.py:267
msgid "There is still room to improve."
msgstr "Hala geliştirilecek yer var."

#: fun_with_flags/achievements.py:266
#: fun_with_flags/achievements.py:269
msgid "We can do better!"
msgstr "Daha iyisini yapabiliriz!"

#: fun_with_flags/achievements.py:277
#: fun_with_flags/achievements.py:280
#, python-format
msgid ""
" Your score of %(_score)s puts you on position %(_position)s out of "
Expand Down Expand Up @@ -152,11 +152,11 @@ msgstr "Karşılaşma zamanlaması başarıyla silindi."
msgid "Settings updated."
msgstr "Ayarlar güncellendi."

#: fun_with_flags/stripe.py:164
#: fun_with_flags/stripe.py:155
msgid "Payment accepted. You're a FwF Unicorn now!"
msgstr "Ödeme kabul edildi. Artık bir FwF Unicorn'sunuz!"

#: fun_with_flags/stripe.py:184
#: fun_with_flags/stripe.py:175
msgid "No payment received."
msgstr "Ödeme alınmadı."

Expand Down

0 comments on commit 4731842

Please sign in to comment.