28 lines
622 B
Python
28 lines
622 B
Python
from config_manager import ConfigManager
|
|
import logging
|
|
import asyncio
|
|
from typing import Optional
|
|
#import os
|
|
#os.chdir(os.path.dirname(__file__))
|
|
|
|
logger = logging.getLogger()
|
|
|
|
class MyApp(ConfigManager):
|
|
def __init__(self, *args, **kwargs):
|
|
super().__init__(*args, **kwargs)
|
|
self.iter = 0
|
|
|
|
def execute(self) -> None:
|
|
logger.info(f"current iteration {self.iter}")
|
|
self.iter += 1
|
|
|
|
async def main():
|
|
app = MyApp("config.yaml")
|
|
app.start()
|
|
logger.info("App started")
|
|
await asyncio.sleep(20)
|
|
await app.stop()
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|
|
|