So i am working on a project, now in python2 the following code works fine. But i want to upgrade to python3 as python2 is no longer supported. So in the pin_event_down function a process, backup is started. The backup process and function are starting some data logging thread, and then it should be closed/ killed. In python2 the sys.exit() works fine and when reading the python documentation they say that you should use the system.exit() does anyone have a clue why the process is never ended? Also every time the specific pin goes down it creates the process again using the same RAM memory again, thus filling the ram with doubles of 1 process.
def pin_event_down(self):
"""
This function is used to create a product pin event.
@return: None.
"""
#do some stuff
Process(target=self.backUp).start()
#do some stuff
def backUp(self):
"""
This function is used to create a backup feedback log.
@return: None.
"""
if product is not None:
self.logger.__init__()
self.logger.start()
#do some stuff
sys.exit()