first commit
This commit is contained in:
1 parent
1e35cf91f7
commit
bae26c43d0
9 files changed
+311
No files matched your search
@@ -0,0 +1,47 @@
|
||||
from logging_config import get_logger
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
||||
class Processor:
|
||||
|
||||
def __init__(self, config, repo):
|
||||
self.config = config
|
||||
self.repo = repo
|
||||
|
||||
def process(self):
|
||||
|
||||
records = self.repo.fetch_expired_records()
|
||||
|
||||
if not records:
|
||||
logger.info(
|
||||
"No expired records found"
|
||||
)
|
||||
return
|
||||
|
||||
for row in records:
|
||||
|
||||
pacs_id = row[0]
|
||||
key_1 = row[1]
|
||||
|
||||
try:
|
||||
|
||||
logger.info(
|
||||
"PACS %s Account %s getting unmarked",
|
||||
pacs_id,
|
||||
key_1
|
||||
)
|
||||
|
||||
self.repo.process_record(
|
||||
pacs_id,
|
||||
key_1
|
||||
)
|
||||
|
||||
except Exception as ex:
|
||||
|
||||
logger.exception(
|
||||
"Failed PACS=%s KEY_1=%s Error=%s",
|
||||
pacs_id,
|
||||
key_1,
|
||||
str(ex)
|
||||
)
|
||||
Reference in new issue
Block a user