Skip to content

Commit

Permalink
Add workload pause between full loops.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Jan 15, 2024
1 parent bf9300c commit 56bd1dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yellowstone/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import json
import logging
import time
from typing import NoReturn, TypedDict

import pugsql
Expand All @@ -19,6 +20,7 @@
from .wikidot import Wikidot

MAX_RETRIES = 4
FULL_WORKLOAD_PAUSE = 10

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -60,6 +62,7 @@ def run(self) -> NoReturn:
self.queue_all_sites()
self.process_all_jobs()
logger.info("Finished everything! Starting new process cycle")
time.sleep(FULL_WORKLOAD_PAUSE)

def insert_all_sites(self) -> None:
for site_slug in self.config.site_slugs:
Expand Down

0 comments on commit 56bd1dc

Please sign in to comment.