refactor: move JOB_FETCH_BITCOIN_PRICE constant to worker.py

Unlike JOB_RANDOM_NUMBER which is used for external job enqueueing,
JOB_FETCH_BITCOIN_PRICE is only used internally by the scheduler.
Move it to worker.py to clarify it's not part of the public job API.
This commit is contained in:
counterweight 2025-12-22 16:10:13 +01:00
parent a5488fd20b
commit 13d2e4adeb
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
2 changed files with 4 additions and 2 deletions

View file

@ -10,7 +10,6 @@ from database import ASYNCPG_DATABASE_URL
# Job type constants
JOB_RANDOM_NUMBER = "random_number"
JOB_FETCH_BITCOIN_PRICE = "fetch_bitcoin_price"
# Connection pool for job enqueueing (lazy initialized)
_pool: asyncpg.Pool | None = None

View file

@ -13,9 +13,12 @@ from pgqueuer.models import Schedule
from pgqueuer.queries import Queries
from database import ASYNCPG_DATABASE_URL
from jobs import JOB_FETCH_BITCOIN_PRICE, JOB_RANDOM_NUMBER
from jobs import JOB_RANDOM_NUMBER
from price_fetcher import PAIR_BTC_EUR, SOURCE_BITFINEX, fetch_btc_eur_price
# Scheduled job type (internal to worker, not enqueued externally)
JOB_FETCH_BITCOIN_PRICE = "fetch_bitcoin_price"
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",