(20250102) Safaricom M-Pesa work.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user