34 lines
663 B
Python
34 lines
663 B
Python
#import os
|
|
#os.chdir(os.path.dirname(__file__))
|
|
|
|
from config_manager import ConfigManager
|
|
import logging
|
|
import asyncio
|
|
from typing import Optional
|
|
|
|
|
|
|
|
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")
|
|
logger.info("App started")
|
|
await app.start()
|
|
|
|
logger.info("App finished")
|
|
|
|
while True:
|
|
await asyncio.sleep(1)
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|
|
|