dev add context for notifcations
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-05-13 14:03:15 +07:00
parent 48c14d475d
commit cda829829c
8 changed files with 31 additions and 22 deletions
@@ -105,7 +105,8 @@ public class MonitoringSearchService {
context.put("status", NotificationType.SEARCH_OPERATION_FAILED.name());
context.put("error_message", e.getMessage());
notificationService.addNotification(NotificationType.SEARCH_OPERATION_FAILED, user.getId(), context);
notificationService.addNotification(NotificationType.SEARCH_OPERATION_FAILED, user.getId(),
context.toString());
}
} else {
log.info("Yandex search is disabled by settings");
@@ -136,7 +137,8 @@ public class MonitoringSearchService {
context.put("next_run", Objects.requireNonNull(calculateNextRun(
monitoring.getMonitoringType())).format(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm")));
notificationService.addNotification(NotificationType.SEARCH_OPERATION_FAILED, user.getId(), context);
notificationService.addNotification(NotificationType.SEARCH_OPERATION_FAILED, user.getId(),
context.toString());
}
} else {
log.info("Google search is disabled by settings");
@@ -182,7 +184,7 @@ public class MonitoringSearchService {
context.put("next_run", Objects.requireNonNull(calculateNextRun(
monitoring.getMonitoringType())).format(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm")));
notificationService.addNotification(NotificationType.TOKEN_NOT_FOUND, user.getId(), context);
notificationService.addNotification(NotificationType.TOKEN_NOT_FOUND, user.getId(), context.toString());
} catch (Exception e) {
log.error("Error processing monitoring search", e);
monitoring.setLastRunStatus("ERROR: " + e.getMessage());
@@ -197,7 +199,8 @@ public class MonitoringSearchService {
context.put("next_run", Objects.requireNonNull(calculateNextRun(
monitoring.getMonitoringType())).format(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm")));
notificationService.addNotification(NotificationType.SEARCH_OPERATION_FAILED, user.getId(), context);
notificationService.addNotification(NotificationType.SEARCH_OPERATION_FAILED, user.getId(),
context.toString());
}
}