mirror of https://github.com/jumpserver/jumpserver
fix: 修复初始化DB port mapper的逻辑
parent
c7882a615f
commit
8fdd89e67c
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
from django.db.models.signals import post_save, post_delete
|
||||
from django.db.utils import ProgrammingError
|
||||
|
||||
from common.signals import django_ready
|
||||
from django.dispatch import receiver
|
||||
|
@ -17,7 +18,10 @@ logger = get_logger(__file__)
|
|||
@receiver(django_ready)
|
||||
def init_db_port_mapper(sender, **kwargs):
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue