Skip to content

Commit 7f4e7b9

Browse files
committed
fix: restore production daily schedule and telegram targets
1 parent a9f364b commit 7f4e7b9

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/google-cloudrun-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ jobs:
132132
echo "Updating existing Cloud Scheduler job"
133133
gcloud scheduler jobs update http ${{ env.JOB_NAME }} \
134134
--location=${{ env.PROJECT_REGION }} \
135-
--schedule="* * * * *" \
135+
--schedule="0 0 * * *" \
136136
--uri="https://${{ env.PROJECT_REGION }}-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/${{ env.PROJECT_ID }}/jobs/${{ env.JOB_NAME }}:run" \
137137
--http-method=POST \
138138
--oauth-service-account-email=${{ vars.GCP_SA_EMAIL }}
139139
else
140140
echo "Creating new Cloud Scheduler job"
141141
gcloud scheduler jobs create http ${{ env.JOB_NAME }} \
142142
--location=${{ env.PROJECT_REGION }} \
143-
--schedule="* * * * *" \
143+
--schedule="0 0 * * *" \
144144
--time-zone="America/Argentina/Buenos_Aires" \
145145
--uri="https://${{ env.PROJECT_REGION }}-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/${{ env.PROJECT_ID }}/jobs/${{ env.JOB_NAME }}:run" \
146146
--http-method=POST \

bot_logic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ async def _update_groups(context: ContextTypes.DEFAULT_TYPE):
426426
c = session.query(Listable).filter_by(id=chat_db_id).first()
427427
if c:
428428
c.validated = False
429-
await context.bot.send_message(chat_id=ROZEN_CHATID, text=f"El grupo {chat_name} murió 💀")
429+
await context.bot.send_message(chat_id=DC_GROUP_CHATID, text=f"El grupo {chat_name} murió 💀")
430430
else:
431431
logger.info(f"Updating URL for group '{chat_name}'")
432432
with get_session() as session:
@@ -528,8 +528,10 @@ def felizdia_text(today):
528528
return "Feliz " + dia + " de " + mes
529529

530530
async def felizdia(context: ContextTypes.DEFAULT_TYPE):
531+
if random.uniform(0, 7) > 1:
532+
return
531533
today = datetime.date.today()
532-
chat_id = ROZEN_CHATID
534+
chat_id = DC_GROUP_CHATID
533535
await context.bot.send_message(chat_id=chat_id, text=felizdia_text(today))
534536

535537
async def actualizarPartidos(context: ContextTypes.DEFAULT_TYPE):

cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ steps:
3838
- '--region=us-central1'
3939
- '--command=python'
4040
- '--args=cron.py'
41-
- '--schedule=* * * * *' # Every minute
41+
- '--schedule=0 0 * * *' # Daily at midnight #callate lereno
4242
- '--time-zone=America/Argentina/Buenos_Aires'

0 commit comments

Comments
 (0)