redefined the API to avoid GC issues during the destruction of the AMAN and its children
This commit is contained in:
@@ -12,8 +12,15 @@ from aman.com.DwdCrawler import DwdCrawler
|
||||
import aman.config.Weather
|
||||
|
||||
class Weather(Thread):
|
||||
def __init__(self, config : aman.config.Weather.Weather):
|
||||
def __init__(self):
|
||||
Thread.__init__(self)
|
||||
|
||||
self.nextUpdate = None
|
||||
self.lastUpdateTried = None
|
||||
self.stopThread = False
|
||||
self.provider = None
|
||||
|
||||
def acquire(self, config : aman.config.Weather.Weather):
|
||||
self.nextUpdate = dt.utcfromtimestamp(int(time.time()))
|
||||
self.lastUpdateTried = None
|
||||
self.stopThread = False
|
||||
@@ -27,8 +34,9 @@ class Weather(Thread):
|
||||
|
||||
self.start()
|
||||
|
||||
def stop(self):
|
||||
def release(self):
|
||||
self.stopThread = True
|
||||
self.join()
|
||||
|
||||
def currentClock():
|
||||
clock = dt.utcfromtimestamp(int(time.time()))
|
||||
|
||||
Reference in New Issue
Block a user