Пример #1
0
from datetime import datetime
from agent import pipeline, source, destination, di
from agent.modules.logger import get_logger

logger = get_logger(__name__, stdout=True)
di.init()

for pipeline_ in pipeline.repository.get_all():
    pipeline_.created_at = datetime.now()
    pipeline.repository.save(pipeline_)
    logger.info(f'Updated created_at column for pipeline ID = {pipeline_.id}')

for source_ in source.repository.get_all():
    source_.created_at = datetime.now()
    source.repository.save(source_)
    logger.info(f'Updated created_at column for source ID = {source_.id}')

destination_ = destination.repository.get()
destination_.created_at = datetime.now()
destination.repository.save(destination_)
logger.info(f'Updated created_at column for destination')
Пример #2
0
def api_client():
    main.app.testing = True
    with main.app.test_client() as client:
        di.init()
        return client
Пример #3
0
def before_request_func():
    di.init()
Пример #4
0
def agent_entry_point():
    di.init()
    agent()
Пример #5
0
def api_client():
    main.app.testing = True
    with main.app.test_client() as client:
        di.init()
        yield client
Пример #6
0
def cli_runner():
    di.init()
    yield CliRunner()