(20250102) Safaricom M-Pesa work.

This commit is contained in:
2025-01-02 08:00:18 +00:00
parent a02b34aeaa
commit 2f563b2a0e
8 changed files with 545 additions and 17 deletions
+7 -2
View File
@@ -53,6 +53,9 @@ from icecream import IceCreamDebugger
# To work with datatypes:
from typing import List, Literal
# To work with date and time:
import time
# *****************************************************************************************************************
# ***** ****
@@ -199,8 +202,10 @@ class ProducerKafka:
:return: None
"""
start_time = time.time()
self.__producer.flush()
self.__printer("Producer flushed.")
message = f"Producer flushed in {time.time() - start_time:.5f} second(s)."
self.__printer(message)
def close(self):
@@ -211,7 +216,7 @@ class ProducerKafka:
if self.__connected:
try:
self.__producer.flush()
self.flush()
self.__printer("Producer closed!")
self.__connected = False
except Exception as exception: self.__printer(exception)