chore: apply pending code updates
This commit is contained in:
@@ -151,7 +151,7 @@ class EmailNotificationService:
|
||||
start_tls=True,
|
||||
)
|
||||
|
||||
logger.info(f"Email notification sent to {to_address}")
|
||||
logger.info("Email notification sent to %s", to_address)
|
||||
return True
|
||||
|
||||
except ImportError:
|
||||
@@ -160,7 +160,7 @@ class EmailNotificationService:
|
||||
)
|
||||
return False
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send email notification: {e}")
|
||||
logger.error("Failed to send email notification: %s", e)
|
||||
return False
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ class WebhookNotificationService:
|
||||
timeout=aiohttp.ClientTimeout(total=self.timeout),
|
||||
) as response:
|
||||
if response.status < 400:
|
||||
logger.info(f"Webhook notification sent to {url}")
|
||||
logger.info("Webhook notification sent to %s", url)
|
||||
return True
|
||||
else:
|
||||
logger.warning(
|
||||
@@ -213,9 +213,9 @@ class WebhookNotificationService:
|
||||
)
|
||||
|
||||
except asyncio.TimeoutError:
|
||||
logger.warning(f"Webhook timeout (attempt {attempt + 1}/{self.max_retries}): {url}")
|
||||
logger.warning("Webhook timeout (attempt %s/%s): %s", attempt + 1, self.max_retries, url)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send webhook (attempt {attempt + 1}/{self.max_retries}): {e}")
|
||||
logger.error("Failed to send webhook (attempt %s/%s): %s", attempt + 1, self.max_retries, e)
|
||||
|
||||
if attempt < self.max_retries - 1:
|
||||
await asyncio.sleep(2 ** attempt) # Exponential backoff
|
||||
@@ -436,7 +436,7 @@ class NotificationService:
|
||||
await self.in_app_service.add_notification(notification)
|
||||
results["in_app"] = True
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send in-app notification: {e}")
|
||||
logger.error("Failed to send in-app notification: %s", e)
|
||||
results["in_app"] = False
|
||||
|
||||
# Send email notification
|
||||
@@ -452,7 +452,7 @@ class NotificationService:
|
||||
)
|
||||
results["email"] = success
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send email notification: {e}")
|
||||
logger.error("Failed to send email notification: %s", e)
|
||||
results["email"] = False
|
||||
|
||||
# Send webhook notifications
|
||||
@@ -476,7 +476,7 @@ class NotificationService:
|
||||
success = await self.webhook_service.send_webhook(str(url), payload)
|
||||
webhook_results.append(success)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send webhook notification to {url}: {e}")
|
||||
logger.error("Failed to send webhook notification to %s: %s", url, e)
|
||||
webhook_results.append(False)
|
||||
|
||||
results["webhook"] = all(webhook_results) if webhook_results else False
|
||||
|
||||
Reference in New Issue
Block a user