Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added debug meesage for post reminder event #4966

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions request-management-api/request_api/services/eventservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from request_api.models.default_method_result import DefaultMethodResult
from request_api.exceptions import BusinessException
from request_api.utils.enums import PaymentEventType
import time as timer

import json
from flask import current_app
Expand Down Expand Up @@ -57,11 +58,32 @@ def posteventforaxisextension(self, ministryrequestid, extensionids, userid, use

def postreminderevent(self):
try:
cfreventresponse = cfrdateevent().createdueevent()
legislativeeventresponse = legislativedateevent().createdueevent()
divisioneventresponse = divisiondateevent().createdueevent()
start_time = timer.time()
cfreventresponse = cfrdateevent().createdueevent()
cfreventresponse_time = timer.time()
print("--- CFR Event Response Time %s seconds ---" % (cfreventresponse_time - start_time))
print(f"cfreventresponse = {cfreventresponse.success}")

legislativeeventresponse = legislativedateevent().createdueevent()
legislativeeventresponse_time = timer.time()
print("--- Legislative Event Response Time %s seconds ---" % (legislativeeventresponse_time - cfreventresponse_time))
print(f"legislativeeventresponse = {legislativeeventresponse.success}")

divisioneventresponse = divisiondateevent().createdueevent()
divisioneventresponse_time = timer.time()
print("--- Division Event Response Time %s seconds ---" % (divisioneventresponse_time - legislativeeventresponse_time))
print(f"divisioneventresponse = {divisioneventresponse.success}")

paymentremindereventresponse = paymentevent().createpaymentreminderevent()
paymentremindereventresponse_time = timer.time()
print("--- Payment Reminder Event Response Time %s seconds ---" % (paymentremindereventresponse_time - divisioneventresponse_time))
print(f"paymentremindereventresponse = {paymentremindereventresponse.success}")

section5pendingresponse = section5pendingevent().createdueevent()
section5pendingresponse_time = timer.time()
print("--- Section 5 Pending Event Response Time %s seconds ---" % (section5pendingresponse_time - paymentremindereventresponse_time))
print(f"section5pendingresponse = {section5pendingresponse.success}")

if cfreventresponse.success == False or legislativeeventresponse.success == False or divisioneventresponse.success == False or paymentremindereventresponse.success == False or section5pendingresponse == False:
current_app.logger.error("FOI Notification failed for reminder event response=%s ; legislative response=%s ; division response=%s ; payment response=%s ; section5pending response=%s" % (cfreventresponse.message, legislativeeventresponse.message, divisioneventresponse.message, paymentremindereventresponse.message, section5pendingresponse.message))
return DefaultMethodResult(False,'Due reminder notifications failed',cfreventresponse.identifier)
Expand Down