Rework init_db error logging
init_db.py and osintbuddy-plugins
This commit is contained in:
@@ -29,6 +29,7 @@ core_plugins = {
|
||||
'Whois': 'whois'
|
||||
}
|
||||
|
||||
|
||||
def load_initial_plugin(db, plugin_mod, plugin_code):
|
||||
load_local_plugin(plugin_mod, plugin_code)
|
||||
|
||||
@@ -42,6 +43,7 @@ def load_initial_plugin(db, plugin_mod, plugin_code):
|
||||
)
|
||||
return crud.entities.create(db=db, obj_in=obj_in)
|
||||
|
||||
|
||||
def init_db(db: Session) -> None:
|
||||
entity_count = crud.entities.count_all(db)[0][0]
|
||||
if entity_count < 14:
|
||||
@@ -55,8 +57,8 @@ def init_db(db: Session) -> None:
|
||||
log.error(e)
|
||||
resp = requests.get(core_ob_url + plugin_mod + '.py')
|
||||
load_initial_plugin(db=db, plugin_mod=plugin_mod, plugin_code=resp.text)
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as e:
|
||||
log.error(e)
|
||||
|
||||
return {
|
||||
"status": "success",
|
||||
|
||||
Submodule backend/osintbuddy-plugins updated: b101312b44...2e8c78d723
Reference in New Issue
Block a user