Browse Source

Take out the trash

pull/4/head
tech234a 3 years ago
parent
commit
cf7bfa726c
2 changed files with 7 additions and 0 deletions
  1. +3
    -0
      export.py
  2. +4
    -0
      worker.py

+ 3
- 0
export.py View File

@@ -29,6 +29,8 @@ from datetime import timedelta

from json import dumps

from gc import collect

import requests

# https://docs.python.org/3/library/html.parser.html
@@ -71,6 +73,7 @@ class MyHTMLParser(HTMLParser):

def subprrun(jobs, headers):
while not jobs.empty():
collect() #cleanup memory
langcode, vid = jobs.get()
vid = vid.strip()
print(langcode, vid)


+ 4
- 0
worker.py View File

@@ -9,6 +9,8 @@ from shutil import make_archive, rmtree

from queue import Queue

from gc import collect

from discovery import getmetadata
from export import subprrun

@@ -99,6 +101,8 @@ while True:
sleep(600)

while True:
collect() #cleanup

try:
mkdir("out")
except:


Loading…
Cancel
Save