Skip to content

Commit

Permalink
Fix #55
Browse files Browse the repository at this point in the history
  • Loading branch information
amadisson committed Sep 1, 2023
1 parent d91d856 commit ef3c3c3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion common/cuckoo/common/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy import inspect as sqlalchemy_inspect

from .log import CuckooGlobalLogger

log = CuckooGlobalLogger(__name__)

class DatabaseError(Exception):
pass

Expand Down Expand Up @@ -173,7 +177,13 @@ def initialize(self, dsn, tablebaseclass, timeout=60,
)

if create_tables:
tablebaseclass.metadata.create_all(engine)
try:
tablebaseclass.metadata.create_all(engine)
except Exception as e:
log.error(
"Failed to create tables", error=e
)


self.initialized = True

Expand Down

0 comments on commit ef3c3c3

Please sign in to comment.