fix: 修复初始化DB port mapper的逻辑

pull/8957/head
Jiangjie.Bai 2 years ago
parent c7882a615f
commit 8fdd89e67c

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
from django.db.models.signals import post_save, post_delete from django.db.models.signals import post_save, post_delete
from django.db.utils import ProgrammingError
from common.signals import django_ready from common.signals import django_ready
from django.dispatch import receiver from django.dispatch import receiver
@ -17,7 +18,10 @@ logger = get_logger(__file__)
@receiver(django_ready) @receiver(django_ready)
def init_db_port_mapper(sender, **kwargs): def init_db_port_mapper(sender, **kwargs):
logger.info('Init db port mapper') logger.info('Init db port mapper')
db_port_manager.init() try:
db_port_manager.init()
except (ProgrammingError,) as e:
logger.error('Init db port mapper error: {}'.format(e))
@receiver(post_save, sender=Application) @receiver(post_save, sender=Application)

Loading…
Cancel
Save