I have a class that checks for new articles on the site (parses the list of URLs, finds the index of the (last) of the last article and if it is not zero - it updates your last url, writes out the URLs one by one in the file and sends it to another class that verifies that they're really new (gets into the same file and extracts the one other url (except the last one, maybe this is our url), compares pictures and makes the metric headings).
The fact that the comparison process is quite long, and tasks are assigned celery every minute. But when javlaetsa the second worker is created, it starts from the beginning and does not see the latest updates of the url (although it is saved in a class variable), while the worker won't finish. While I wrote pornfellow check, but it's probably not done. The question is how to make status information (last url) for global workarou? or how to tell celery to start a new worker until the previous is finished, and if he missed a minute (though async starts to limp, if I understand correctly)
Maybe each time I create a new instance FlowListener that it retrieves the latest file?
listener = FlowListener()
in the toolbox, where classes are
last = open('last_article_log.txt').readlines()[-1].strip()
self.log = log
self.url = url
self.soup = BeautifulSoup(requests.get(self.url).text, 'lxml')
links = self.soup.table.find_all('a')
self.urls = 
for link in links:
num = self.urls.index(FlowListener.last)
FlowListener.last = self.urls.strip()
for url in reversed(self.urls[:num]):
with open(self.log, 'a') as log: