load async worker
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
def main_loader(unit, tool):
|
||||
print(f'{__name__}: {unit} - {tool}')
|
||||
return f'{__name__}: {unit} - {tool}'
|
||||
#!.venv/bin/python
|
||||
# Import necessary modules
|
||||
from utils.database.loader_action import load_data, update_status, DATA_LOADED
|
||||
from utils.parsers.data_preparation import make_matrix
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Define the main function for loading data
|
||||
async def main_loader(cfg: object, id: int) -> None:
|
||||
# Create a matrix of values from the data
|
||||
matrice_valori = make_matrix(cfg, id)
|
||||
# Load the data into the database
|
||||
if load_data(cfg, matrice_valori):
|
||||
update_status(cfg, id, DATA_LOADED)
|
||||
Reference in New Issue
Block a user