Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbruinsslot committed Nov 18, 2024
1 parent 6d7bd0e commit 33a72d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mula/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ else ifeq ($(revid),)
$(HIDE) (echo "ERROR: Specify a message with m={message} and a rev-id with revid={revid} (e.g. 0001 etc.)"; exit 1)
else
docker compose run --rm scheduler \
alembic --config /app/scheduler/scheduler/alembic.ini \
alembic --config /app/scheduler/scheduler/storage/migrations/alembic.ini \
revision --autogenerate \
-m "$(m)" --rev-id "$(revid)"
endif

migrate: ## Run migrations using alembic.
docker compose run scheduler \
alembic --config /app/scheduler/scheduler/alembic.ini \
alembic --config /app/scheduler/scheduler/storage/migrations/alembic.ini \
upgrade head

##
Expand Down
2 changes: 1 addition & 1 deletion mula/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
shopt -s nocasematch

if [ "$DATABASE_MIGRATION" = "1" ] || [[ $DATABASE_MIGRATION == "true" ]]; then
python -m alembic --config /app/scheduler/scheduler/alembic.ini upgrade head
python -m alembic --config /app/scheduler/scheduler/storage/migrations/alembic.ini upgrade head
fi

exec "$@"
5 changes: 2 additions & 3 deletions mula/scheduler/schedulers/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

from scheduler import clients, context, models, storage, utils
from scheduler.schedulers.queue import PriorityQueue
from scheduler.schedulers.queue.errors import (InvalidItemError,
NotAllowedError, QueueFullError)
from scheduler.schedulers.queue.errors import InvalidItemError, NotAllowedError, QueueFullError
from scheduler.utils import cron, thread

tracer = trace.get_tracer(__name__)
Expand Down Expand Up @@ -117,7 +116,7 @@ def push_items_to_queue(self, items: list[models.Task]) -> None:
queue_id=self.queue.pq_id,
scheduler_id=self.scheduler_id,
)
continue u
continue
except Exception as exc:
self.logger.error(
"Unable to push item %s to queue %s",
Expand Down

0 comments on commit 33a72d7

Please sign in to comment.