Skip to content

Commit

Permalink
chore: Adding log on resendNotifications
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-putzu committed Aug 27, 2024
1 parent 1f1aae3 commit 0f3e6e4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package it.pagopa.selfcare.onboarding.service;

import com.microsoft.azure.functions.ExecutionContext;
import io.quarkus.runtime.util.ExceptionUtil;
import it.pagopa.selfcare.onboarding.dto.ResendNotificationsFilters;
import it.pagopa.selfcare.onboarding.entity.Onboarding;
import jakarta.enterprise.context.ApplicationScoped;
Expand Down Expand Up @@ -31,7 +32,11 @@ public ResendNotificationsFilters resendNotifications(ResendNotificationsFilters
List<Onboarding> onboardingsToResend = onboardingService.getOnboardingsToResend(filters, page, pageSize);
context.getLogger().info(() -> String.format("Found: %s onboardings to send for page: %s ", onboardingsToResend.size(), page));
for (Onboarding onboarding : onboardingsToResend) {
notificationEventService.send(context, onboarding, null, filters.getNotificationEventTraceId());
try {
notificationEventService.send(context, onboarding, null, filters.getNotificationEventTraceId());
} catch (Exception e) {
context.getLogger().severe(() -> String.format("ERROR: Sending onboarding %s error: %s ", onboarding.getId(), ExceptionUtil.generateStackTrace(e)));
}
}

if(onboardingsToResend.isEmpty() || onboardingsToResend.size() < pageSize) {
Expand Down

0 comments on commit 0f3e6e4

Please sign in to comment.