File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ async def sugerirNoticia(update: Update, context: ContextTypes.DEFAULT_TYPE):
6666
6767async def get_logs (update : Update , context : ContextTypes .DEFAULT_TYPE ):
6868 user_id = update .effective_user .id
69- if user_id not in admin_ids :
69+ if user_id not in admin_ids and str (user_id ) not in admin_ids :
70+ logger .warning (f"Unauthorized user { user_id } tried to access /logs" )
7071 return
7172
7273 try :
@@ -77,7 +78,7 @@ async def get_logs(update: Update, context: ContextTypes.DEFAULT_TYPE):
7778 await update .message .reply_text ("Buscando errores en Google Cloud Logging..." )
7879 client = gcp_logging .Client ()
7980
80- filter_str = 'resource.type="cloud_run_revision" AND severity>=ERROR AND resource.labels.service_name="dcubabot" '
81+ filter_str = 'severity>=ERROR AND ( resource.type="cloud_run_revision" OR resource.type="cloud_run_job") '
8182 entries = client .list_entries (filter_ = filter_str , order_by = gcp_logging .DESCENDING , max_results = 50 )
8283
8384 log_msgs = []
You can’t perform that action at this time.
0 commit comments