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

Dev shiva 4077 added more debug #4969

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 13 additions & 1 deletion request-management-api/request_api/services/events/cfrdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import os
from flask import current_app
from dateutil.parser import parse
import time as t

class cfrdateevent(duecalculator):
""" FOI Event management service
Expand All @@ -24,18 +25,29 @@ class cfrdateevent(duecalculator):
def createdueevent(self):
try:
_today = self.gettoday()
notificationservice().dismissremindernotification("ministryrequest", self.__notificationtype())
time = t.time()
notificationservice().dismissremindernotification("ministryrequest", self.__notificationtype())
dismissremindernotification_time = t.time()
print("dismissremindernotification_time: %s" % (dismissremindernotification_time - time))

ca_holidays = self.getholidays()
time = t.time()
_upcomingdues = FOIMinistryRequest.getupcomingcfrduerecords()
getupcomingcfrduerecords_time = t.time()
print("getupcomingcfrduerecords_time: %s" % (getupcomingcfrduerecords_time - time))

for entry in _upcomingdues:
_duedate = self.formatduedate(entry['cfrduedate'])
message = None
if _duedate == _today:
message = self.__todayduemessage()
elif self.getpreviousbusinessday(entry['cfrduedate'],ca_holidays) == _today:
message = self.__upcomingduemessage(_duedate)
createnotification_time = t.time()
self.__createnotification(message,entry['foiministryrequestid'])
self.__createcomment(entry, message)
createnotification_time = t.time() - createnotification_time
print("createnotification_time: %s" % createnotification_time)
return DefaultMethodResult(True,'CFR reminder notifications created',_today)
except BusinessException as exception:
current_app.logger.error("%s,%s" % ('CFR reminder Notification Error', exception.message))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import os
from flask import current_app
from dateutil.parser import parse
import time as t

class legislativedateevent(duecalculator):
""" FOI Event management service
Expand All @@ -35,8 +36,14 @@ def createdueevent(self):
message = self.__todayduemessage()
elif self.getpreviousbusinessday(entry['duedate'],ca_holidays) == _today or self.getbusinessdaysbetween(entry['duedate'],_today) == 5:
message = self.__upcomingduemessage(_duedate)
createnotification_time = t.time()
self.__createnotification(message,entry['foiministryrequestid'])
createnotification_time = t.time() - createnotification_time
print("createnotification_time: %s" % createnotification_time)
createcomment_time = t.time()
self.__createcomment(entry, message)
createcomment_time = t.time() - createcomment_time
print("createcomment_time: %s" % createcomment_time)
return DefaultMethodResult(True,'Legislative reminder notifications created',_today)
except BusinessException as exception:
current_app.logger.error("%s,%s" % ('Legislative reminder Notification Error', exception.message))
Expand Down
Loading