示例#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
文件: debug.py 项目: anodot/daria
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
文件: __init__.py 项目: anodot/daria
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()