update nas target, documentation
This commit is contained in:
@@ -2,10 +2,10 @@ FROM python:latest
|
||||
|
||||
ENV TZ Europe/Zurich
|
||||
|
||||
RUN mkdir -p /app/auto_news
|
||||
RUN mkdir -p /app/news_fetch
|
||||
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
RUN python3 -m pip install -r /app/requirements.txt
|
||||
|
||||
COPY . /app/auto_news
|
||||
WORKDIR /app/auto_news
|
||||
COPY . /app/news_fetch
|
||||
WORKDIR /app/news_fetch
|
||||
|
@@ -126,13 +126,12 @@ class Dispatcher(Thread):
|
||||
|
||||
|
||||
|
||||
# def manual_processing(self, articles, workers):
|
||||
# for w in workers:
|
||||
# w.start()
|
||||
|
||||
# for article in articles:
|
||||
# notifier = lambda article: logger.info(f"Completed manual actions for {article}")
|
||||
# ArticleWatcher(article, workers_manual = workers, notifier = notifier) # Article watcher wants a thread to link article to TODO: handle threads as a kwarg
|
||||
class PrintWorker:
|
||||
def send(self, article):
|
||||
print(f"Uploaded article {article}")
|
||||
def keep_alive(self): # keeps script running, because there is nothing else in the main thread
|
||||
while True: sleep(1)
|
||||
|
||||
|
||||
|
||||
@@ -140,11 +139,6 @@ if __name__ == "__main__":
|
||||
dispatcher = Dispatcher()
|
||||
|
||||
if "upload" in sys.argv:
|
||||
class PrintWorker:
|
||||
def send(self, article):
|
||||
print(f"Uploaded article {article}")
|
||||
def keep_alive(self): # keeps script running, because there is nothing else in the main thread
|
||||
while True: sleep(1)
|
||||
|
||||
articles = models.ArticleDownload.select().where(models.ArticleDownload.archive_url == "" or models.ArticleDownload.archive_url == "TODO:UPLOAD").execute()
|
||||
logger.info(f"Launching upload to archive for {len(articles)} articles.")
|
||||
|
Reference in New Issue
Block a user