Skip to content

Commit

Permalink
chore: Add error logging to Edge V2 migration command (#4549)
Browse files Browse the repository at this point in the history
  • Loading branch information
khvn26 authored Aug 28, 2024
1 parent af89de7 commit d083e79
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/edge_api/management/commands/migrate_to_edge_v2.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import logging
from typing import Any

from django.core.management import BaseCommand

from projects.models import EdgeV2MigrationStatus, Project
from projects.tasks import migrate_project_environments_to_v2

logger = logging.getLogger(__name__)


class Command(BaseCommand):
def handle(self, *args: Any, **options: Any) -> str | None:
Expand All @@ -14,4 +17,7 @@ def handle(self, *args: Any, **options: Any) -> str | None:
EdgeV2MigrationStatus.INCOMPLETE,
)
).values_list("id", flat=True):
migrate_project_environments_to_v2(project_id)
try:
migrate_project_environments_to_v2(project_id)
except Exception: # pragma: no cover
logger.exception("Error migrating project id=%d", project_id)

0 comments on commit d083e79

Please sign in to comment.