From 26f09de096fbbbd49f57046bea6db3fe29fafbbd Mon Sep 17 00:00:00 2001 From: bral <54455457+bralbral@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:18:56 +0300 Subject: [PATCH] delete deprecated code (#91) --- src/bot/commands.py | 1 - src/bot/dialogs/channel/on_click.py | 22 -- src/bot/dialogs/channel/windows.py | 8 - src/constants.py | 2 +- src/db/dal.py | 44 +-- src/db/dao/__init__.py | 3 +- src/db/dao/channel_errors.py | 39 -- .../migrations/versions/da6a2af82a8b_init.py | 7 - .../migrations/versions/f78d1309ec45_init.py | 43 +++ src/db/models/__init__.py | 2 - src/db/models/channel_errors.py | 38 -- src/db/svg_schema/db-schema | 339 +++++++----------- src/db/svg_schema/db-schema.svg | 338 +++++++---------- src/db/svg_schema/generator.py | 3 +- src/dto/__init__.py | 4 - src/dto/channel.py | 12 +- src/dto/channel_error.py | 27 -- .../jobs/auto_turn_off_channel/__init__.py | 3 - .../jobs/auto_turn_off_channel/constants.py | 4 - .../jobs/auto_turn_off_channel/turn_off.py | 16 - 20 files changed, 328 insertions(+), 627 deletions(-) delete mode 100644 src/db/dao/channel_errors.py create mode 100644 src/db/migrations/versions/f78d1309ec45_init.py delete mode 100644 src/db/models/channel_errors.py delete mode 100644 src/dto/channel_error.py delete mode 100644 src/scheduler/jobs/auto_turn_off_channel/__init__.py delete mode 100644 src/scheduler/jobs/auto_turn_off_channel/constants.py delete mode 100644 src/scheduler/jobs/auto_turn_off_channel/turn_off.py diff --git a/src/bot/commands.py b/src/bot/commands.py index 04bed52..87d9cee 100644 --- a/src/bot/commands.py +++ b/src/bot/commands.py @@ -4,7 +4,6 @@ def superuser_commands() -> list[BotCommand]: commands = [ BotCommand(command="add_user", description="Add user to bot."), - # BotCommand(command="users", description="Start Users Administration Dialog."), BotCommand(command="add_channels", description="Add channels from file."), BotCommand(command="scheduler_start", description="Start scheduler"), BotCommand(command="scheduler_pause", description="Stop scheduler"), diff --git a/src/bot/dialogs/channel/on_click.py b/src/bot/dialogs/channel/on_click.py index 3ca82a5..01aceba 100644 --- a/src/bot/dialogs/channel/on_click.py +++ b/src/bot/dialogs/channel/on_click.py @@ -52,27 +52,6 @@ async def on_turn_off(callback: CallbackQuery, button: Button, manager: DialogMa await manager.switch_to(ChannelsSG.turn_off) -async def on_turn_delete_errors( - callback: CallbackQuery, button: Button, manager: DialogManager -): - index = manager.dialog_data["current_page"] - channel: ChannelRetrieveDTO = manager.dialog_data["channels"][index] - - if channel.id: - dal: DataAccessLayer = manager.start_data["dal"] - - result = await dal.clear_channel_errors(channel_id=channel.id) - - if result: - await callback.answer("Success.") - else: - await callback.answer("Cannot delete error rows.") - else: - await callback.answer("Cannot delete error rows.") - - await manager.switch_to(state=ChannelsSG.scrolling) - - async def on_turn_on(callback: CallbackQuery, button: Button, manager: DialogManager): await manager.switch_to(ChannelsSG.turn_on) @@ -114,7 +93,6 @@ async def on_perform_update( "on_finish", "on_perform_delete", "on_perform_update", - "on_turn_delete_errors", "on_turn_off", "on_turn_on", ] diff --git a/src/bot/dialogs/channel/windows.py b/src/bot/dialogs/channel/windows.py index c05f08f..b7ec96f 100644 --- a/src/bot/dialogs/channel/windows.py +++ b/src/bot/dialogs/channel/windows.py @@ -22,7 +22,6 @@ from .on_click import on_finish from .on_click import on_perform_delete from .on_click import on_perform_update -from .on_click import on_turn_delete_errors from .on_click import on_turn_off from .on_click import on_turn_on from .widgets import Viewer @@ -69,13 +68,6 @@ def scroll_window(): Button(Const("✏️ Turn on"), id="off", on_click=on_turn_on), Button(Const("✏️ Turn off"), id="on", on_click=on_turn_off), ), - Row( - Button( - Const("🧽 Delete errors"), - id="errors", - on_click=on_turn_delete_errors, - ) - ), when=F["role"] == UserRole.SUPERUSER, ), Row( diff --git a/src/constants.py b/src/constants.py index a47ad3f..f2ab57f 100755 --- a/src/constants.py +++ b/src/constants.py @@ -10,7 +10,7 @@ SQLITE_DATABASE_FILE_PATH: str = os.environ.get( "SQLITE_DATABASE_FILE_PATH", os.path.join(ROOT_DIR, "youtube-notifier-bot.db") ) -VERSION: str = "2024-08-01.23" +VERSION: str = "2024-08-23.20" __all__ = [ "CONFIG_FILE_PATH", diff --git a/src/db/dal.py b/src/db/dal.py index 6015a6b..9a746b1 100644 --- a/src/db/dal.py +++ b/src/db/dal.py @@ -7,19 +7,15 @@ from ..constants import SQLITE_DATABASE_FILE_PATH from ..dto import ChannelCreateDTO -from ..dto import ChannelErrorCreateDTO -from ..dto import ChannelErrorRetrieveDTO from ..dto import ChannelRetrieveDTO from ..dto import MessageLogCreateDTO from ..dto import MessageLogRetrieveDTO from ..dto import UserCreateDTO from ..dto import UserRetrieveDTO from .dao import ChannelDAO -from .dao import ChannelErrorDAO from .dao import MessageLogDAO from .dao import UserRepo from .exceptions import DatabaseDoesNotExist -from .models import ChannelErrorORM from .models import ChannelORM from .models import MessageLogORM from .models import UserORM @@ -67,11 +63,6 @@ def __init_repo(self) -> None: schema=ChannelRetrieveDTO, model_orm=ChannelORM, ) - self.__channel_error_repo = ChannelErrorDAO( - session=self.__session, - schema=ChannelErrorRetrieveDTO, - model_orm=ChannelErrorORM, - ) self.__message_log_repo = MessageLogDAO( session=self.__session, schema=MessageLogRetrieveDTO, @@ -136,9 +127,9 @@ async def get_last_published_message_id(self) -> Optional[int]: """ :return: """ - message_log_dto: Optional[ - MessageLogRetrieveDTO - ] = await self.__message_log_repo.get_by_attr() + message_log_dto: Optional[MessageLogRetrieveDTO] = ( + await self.__message_log_repo.get_by_attr() + ) if message_log_dto: return message_log_dto.message_id @@ -164,17 +155,6 @@ async def create_channel( """ return await self.__channel_repo.create(channel_schema=channel_schema) - async def create_channel_error( - self, channel_error_schema: ChannelErrorCreateDTO - ) -> int: - """ - :param channel_error_schema: - :return: - """ - return await self.__channel_error_repo.create( - channel_error_schema=channel_error_schema - ) - async def get_channels(self, **kwargs) -> list[ChannelRetrieveDTO]: """ :param kwargs: @@ -201,23 +181,5 @@ async def update_channel_by_id(self, _id: int, data: dict) -> Optional[int]: """ return await self.__channel_repo.update_by_pk(pk=_id, data=data) - async def auto_turn_off_channels(self, errors_limit: int) -> None: - """ - :return: - """ - channel_ids = await self.__channel_error_repo.get_channel_ids_with_errors_upper_then_limit( - limit=errors_limit - ) - - for channel_id in channel_ids: - await self.update_channel_by_id(_id=channel_id, data={"enabled": False}) - - return - - async def clear_channel_errors(self, channel_id: int) -> list[int]: - return await self.__channel_error_repo.delete_by_attr( - **{"channel_id": channel_id} - ) - __all__ = ["DataAccessLayer"] diff --git a/src/db/dao/__init__.py b/src/db/dao/__init__.py index 9df0132..e510865 100644 --- a/src/db/dao/__init__.py +++ b/src/db/dao/__init__.py @@ -1,6 +1,5 @@ -from .channel_errors import ChannelErrorDAO from .channels import ChannelDAO from .message_log import MessageLogDAO from .users import UserRepo -__all__ = ["ChannelDAO", "ChannelErrorDAO", "MessageLogDAO", "UserRepo"] +__all__ = ["ChannelDAO", "MessageLogDAO", "UserRepo"] diff --git a/src/db/dao/channel_errors.py b/src/db/dao/channel_errors.py deleted file mode 100644 index a132e30..0000000 --- a/src/db/dao/channel_errors.py +++ /dev/null @@ -1,39 +0,0 @@ -from sqlalchemy import func -from sqlalchemy import insert -from sqlalchemy import select - -from ..models import ChannelErrorORM -from ..models import ChannelORM -from .base import DAO -from src.dto import ChannelErrorCreateDTO - - -class ChannelErrorDAO(DAO): - async def create(self, channel_error_schema: ChannelErrorCreateDTO) -> int: - insert_stmt = ( - insert(ChannelErrorORM) - .values(**channel_error_schema.model_dump()) - .returning(ChannelErrorORM.id) - ) - await self.session.execute(insert_stmt) - result = await self.session.execute(insert_stmt) - _id: int = result.scalars().one() - return _id - - async def get_channel_ids_with_errors_upper_then_limit( - self, limit: int - ) -> list[int]: - channel_sub = select(ChannelORM.id).where(ChannelORM.enabled == True).distinct() - - stm = ( - select(ChannelErrorORM.channel_id, func.count(ChannelErrorORM.channel_id)) - .where(ChannelErrorORM.channel_id.in_(channel_sub)) - .group_by(ChannelErrorORM.channel_id) - ).having(func.count(ChannelErrorORM.channel_id) > limit) - - res = await self.session.scalars(statement=stm) - ids = res.all() - return list(ids) - - -__all__ = ["ChannelErrorDAO"] diff --git a/src/db/migrations/versions/da6a2af82a8b_init.py b/src/db/migrations/versions/da6a2af82a8b_init.py index cff3bd2..634351e 100644 --- a/src/db/migrations/versions/da6a2af82a8b_init.py +++ b/src/db/migrations/versions/da6a2af82a8b_init.py @@ -1,10 +1,3 @@ -"""init - -Revision ID: da6a2af82a8b -Revises: -Create Date: 2023-12-19 17:55:42.111237 - -""" from typing import Sequence from typing import Union diff --git a/src/db/migrations/versions/f78d1309ec45_init.py b/src/db/migrations/versions/f78d1309ec45_init.py new file mode 100644 index 0000000..edd0c1d --- /dev/null +++ b/src/db/migrations/versions/f78d1309ec45_init.py @@ -0,0 +1,43 @@ +from typing import Sequence +from typing import Union + +import sqlalchemy as sa +from alembic import op + + +# revision identifiers, used by Alembic. +revision: str = "f78d1309ec45" +down_revision: Union[str, None] = "da6a2af82a8b" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index("ix_channel_errors_error", table_name="channel_errors") + op.drop_table("channel_errors") + op.drop_index("ix_users_is_admin", table_name="users") + op.drop_column("users", "is_admin") + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.add_column("users", sa.Column("is_admin", sa.BOOLEAN(), nullable=True)) + op.create_index("ix_users_is_admin", "users", ["is_admin"], unique=False) + op.create_table( + "channel_errors", + sa.Column("id", sa.INTEGER(), nullable=False), + sa.Column("error", sa.VARCHAR(length=512), nullable=False), + sa.Column("created_at", sa.TIMESTAMP(), nullable=False), + sa.Column("updated_at", sa.TIMESTAMP(), nullable=False), + sa.Column("channel_id", sa.INTEGER(), nullable=False), + sa.ForeignKeyConstraint( + ["channel_id"], ["channels.id"], onupdate="CASCADE", ondelete="CASCADE" + ), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index( + "ix_channel_errors_error", "channel_errors", ["error"], unique=False + ) + # ### end Alembic commands ### diff --git a/src/db/models/__init__.py b/src/db/models/__init__.py index e081bac..1c9ff9d 100644 --- a/src/db/models/__init__.py +++ b/src/db/models/__init__.py @@ -1,13 +1,11 @@ from .channel import ChannelORM from .channel import ChannelORMRelatedModel -from .channel_errors import ChannelErrorORM from .message_log import MessageLogORM from .mixins.base import ModelORM from .user import UserORM from .user import UserORMRelatedModel __all__ = [ - "ChannelErrorORM", "ChannelORM", "ChannelORMRelatedModel", "MessageLogORM", diff --git a/src/db/models/channel_errors.py b/src/db/models/channel_errors.py deleted file mode 100644 index e5913b1..0000000 --- a/src/db/models/channel_errors.py +++ /dev/null @@ -1,38 +0,0 @@ -from sqlalchemy import Column -from sqlalchemy import Integer -from sqlalchemy import String -from sqlalchemy.orm import relationship - -from .channel import ChannelORMRelatedModel -from .mixins import ModelORM -from .mixins import RepresentationMixin -from .mixins import TimestampsMixin - - -class ChannelErrorORM( - ModelORM, TimestampsMixin, ChannelORMRelatedModel, RepresentationMixin -): - """ - Base - """ - - __tablename__ = "channel_errors" - - # some features with autoincrement - # https://docs.sqlalchemy.org/en/20/dialects/sqlite.html#allowing-autoincrement-behavior-sqlalchemy-types-other-than-integer-integer - id = Column( - Integer, - primary_key=True, - autoincrement=True, - ) - error = Column(String(length=512), nullable=False, index=True) - channel = relationship( - "ChannelORM", - backref="errors", - foreign_keys="ChannelErrorORM.channel_id", - uselist=False, - lazy="selectin", - ) - - -__all__ = ["ChannelErrorORM"] diff --git a/src/db/svg_schema/db-schema b/src/db/svg_schema/db-schema index 1555e1b..bc3c28b 100644 --- a/src/db/svg_schema/db-schema +++ b/src/db/svg_schema/db-schema @@ -3,69 +3,69 @@ - + - + %3 - + UserORM - - - UserORM - - - id - - - INTEGER (PK) - - - user_id - - - BIGINT (Index) - - - username - - - VARCHAR(255) (Index) - - - firstname - - - VARCHAR(255) (Index) - - - lastname - - - VARCHAR(255) (Index) - - - is_superuser - - - BOOLEAN (Index) - - - created_at - - - TIMESTAMP () - - - updated_at - - - TIMESTAMP () + + + UserORM + + + id + + + INTEGER (PK) + + + user_id + + + BIGINT (Index) + + + username + + + VARCHAR(255) (Index) + + + firstname + + + VARCHAR(255) (Index) + + + lastname + + + VARCHAR(255) (Index) + + + is_superuser + + + BOOLEAN (Index) + + + created_at + + + TIMESTAMP () + + + updated_at + + + TIMESTAMP () @@ -74,51 +74,51 @@ ChannelORM - - - ChannelORM - - - id - - - INTEGER (PK) - - - url - - - VARCHAR(255) (Index) - - - label - - - VARCHAR(255) (Index) - - - enabled - - - BOOLEAN (Index) - - - created_at - - - TIMESTAMP () - - - updated_at - - - TIMESTAMP () - - - user_id - - - INTEGER () + + + ChannelORM + + + id + + + INTEGER (PK) + + + url + + + VARCHAR(255) (Index) + + + label + + + VARCHAR(255) (Index) + + + enabled + + + BOOLEAN (Index) + + + created_at + + + TIMESTAMP () + + + updated_at + + + TIMESTAMP () + + + user_id + + + INTEGER () @@ -127,126 +127,63 @@ UserORM->ChannelORM - - + + - channels + channels ChannelORM->UserORM - - - - - user - - - - ChannelErrorORM - - - - - ChannelErrorORM - - - id - - - INTEGER (PK) - - - error - - - VARCHAR(512) (Index) - - - created_at - - - TIMESTAMP () - - - updated_at - - - TIMESTAMP () - - - channel_id - - - INTEGER () + + - - - - ChannelORM->ChannelErrorORM - - - - - - - errors + user MessageLogORM - - - MessageLogORM - - - id - - - INTEGER (PK) - - - message_id - - - BIGINT (Index) - - - text - - - VARCHAR () - - - created_at - - - TIMESTAMP () - - - updated_at - - - TIMESTAMP () - - - - - - ChannelErrorORM->ChannelORM - - - - + + + MessageLogORM + + + id + + + INTEGER (PK) + + + message_id + + + BIGINT (Index) + + + text + + + VARCHAR () + + + created_at + + + TIMESTAMP () + + + updated_at + + + TIMESTAMP () - channel diff --git a/src/db/svg_schema/db-schema.svg b/src/db/svg_schema/db-schema.svg index c7b9546..48be8b5 100644 --- a/src/db/svg_schema/db-schema.svg +++ b/src/db/svg_schema/db-schema.svg @@ -4,66 +4,66 @@ - - + + %3 - + UserORM - - -UserORM - - -id - - -INTEGER (PK) - - -user_id - - -BIGINT (Index) - - -username - - -VARCHAR(255) (Index) - - -firstname - - -VARCHAR(255) (Index) - - -lastname - - -VARCHAR(255) (Index) - - -is_superuser - - -BOOLEAN (Index) - - -created_at - - -TIMESTAMP () - - -updated_at - - -TIMESTAMP () + + +UserORM + + +id + + +INTEGER (PK) + + +user_id + + +BIGINT (Index) + + +username + + +VARCHAR(255) (Index) + + +firstname + + +VARCHAR(255) (Index) + + +lastname + + +VARCHAR(255) (Index) + + +is_superuser + + +BOOLEAN (Index) + + +created_at + + +TIMESTAMP () + + +updated_at + + +TIMESTAMP () @@ -71,51 +71,51 @@ ChannelORM - - -ChannelORM - - -id - - -INTEGER (PK) - - -url - - -VARCHAR(255) (Index) - - -label - - -VARCHAR(255) (Index) - - -enabled - - -BOOLEAN (Index) - - -created_at - - -TIMESTAMP () - - -updated_at - - -TIMESTAMP () - - -user_id - - -INTEGER () + + +ChannelORM + + +id + + +INTEGER (PK) + + +url + + +VARCHAR(255) (Index) + + +label + + +VARCHAR(255) (Index) + + +enabled + + +BOOLEAN (Index) + + +created_at + + +TIMESTAMP () + + +updated_at + + +TIMESTAMP () + + +user_id + + +INTEGER () @@ -123,121 +123,61 @@ UserORM->ChannelORM - - + + -channels +channels ChannelORM->UserORM - - - - -user - - - -ChannelErrorORM - - - -ChannelErrorORM - - -id - - -INTEGER (PK) - - -error - - -VARCHAR(512) (Index) - - -created_at - - -TIMESTAMP () - - -updated_at - - -TIMESTAMP () - - -channel_id - - -INTEGER () + + - - - -ChannelORM->ChannelErrorORM - - - - - -errors +user MessageLogORM - - -MessageLogORM - - -id - - -INTEGER (PK) - - -message_id - - -BIGINT (Index) - - -text - - -VARCHAR () - - -created_at - - -TIMESTAMP () - - -updated_at - - -TIMESTAMP () - - - - - -ChannelErrorORM->ChannelORM - - - + + +MessageLogORM + + +id + + +INTEGER (PK) + + +message_id + + +BIGINT (Index) + + +text + + +VARCHAR () + + +created_at + + +TIMESTAMP () + + +updated_at + + +TIMESTAMP () -channel diff --git a/src/db/svg_schema/generator.py b/src/db/svg_schema/generator.py index bb30cc2..7cfcdcf 100644 --- a/src/db/svg_schema/generator.py +++ b/src/db/svg_schema/generator.py @@ -1,14 +1,13 @@ from sqlalchemy_data_model_visualizer import add_web_font_and_interactivity from sqlalchemy_data_model_visualizer import generate_data_model_diagram -from src.db.models import ChannelErrorORM from src.db.models import ChannelORM from src.db.models import MessageLogORM from src.db.models import UserORM def generate(): - models = [UserORM, MessageLogORM, ChannelORM, ChannelErrorORM] + models = [UserORM, MessageLogORM, ChannelORM] generate_data_model_diagram(models=models, output_file="db-schema", add_labels=True) add_web_font_and_interactivity( input_svg_file="db-schema.svg", output_svg_file="db-schema" diff --git a/src/dto/__init__.py b/src/dto/__init__.py index 0cbc35b..c2bb947 100644 --- a/src/dto/__init__.py +++ b/src/dto/__init__.py @@ -1,8 +1,6 @@ from .base import DTO from .channel import ChannelCreateDTO from .channel import ChannelRetrieveDTO -from .channel_error import ChannelErrorCreateDTO -from .channel_error import ChannelErrorRetrieveDTO from .message_log import MessageLogCreateDTO from .message_log import MessageLogRetrieveDTO from .user import UserCreateDTO @@ -12,8 +10,6 @@ __all__ = [ "ChannelCreateDTO", - "ChannelErrorCreateDTO", - "ChannelErrorRetrieveDTO", "ChannelRetrieveDTO", "DTO", "MessageLogCreateDTO", diff --git a/src/dto/channel.py b/src/dto/channel.py index 1bed9c7..c6031cf 100644 --- a/src/dto/channel.py +++ b/src/dto/channel.py @@ -26,8 +26,7 @@ def url_in_username(cls, v: str) -> str: return v.lower() -class ChannelCreateDTO(ChannelBaseDTO): - ... +class ChannelCreateDTO(ChannelBaseDTO): ... class ChannelRetrieveDTO(ChannelCreateDTO): @@ -35,12 +34,6 @@ class ChannelRetrieveDTO(ChannelCreateDTO): user: UserRetrieveDTO created_at: datetime updated_at: datetime - errors: list[str] - - @field_validator("errors", mode="before") - def extract_only_error_message(cls, v, **kwargs): - if isinstance(v, list): - return [_.error for _ in v] def to_html(self) -> str: user_attribute_list = [self.user.username, self.user.user_id] @@ -55,8 +48,7 @@ def to_html(self) -> str: f"├──url: {self.url}
" f"├──added by: {user_link}
" f"├──added at: {self.created_at}
" - f"├──last modified at: {self.updated_at}
" - f"└──Errors count: {len(self.errors)}
" + f"└──last modified at: {self.updated_at}
" ) diff --git a/src/dto/channel_error.py b/src/dto/channel_error.py deleted file mode 100644 index a4370b1..0000000 --- a/src/dto/channel_error.py +++ /dev/null @@ -1,27 +0,0 @@ -from datetime import datetime - -from pydantic import ConfigDict -from pydantic import Field - -from .base import DTO -from .channel import ChannelRetrieveDTO - - -class ChannelErrorBaseDTO(DTO): - error: str = Field(max_length=512) - - model_config = ConfigDict(from_attributes=True) - - -class ChannelErrorCreateDTO(ChannelErrorBaseDTO): - channel_id: int - - -class ChannelErrorRetrieveDTO(ChannelErrorCreateDTO): - id: int - channel: ChannelRetrieveDTO - created_at: datetime - updated_at: datetime - - -__all__ = ["ChannelErrorCreateDTO", "ChannelErrorRetrieveDTO"] diff --git a/src/scheduler/jobs/auto_turn_off_channel/__init__.py b/src/scheduler/jobs/auto_turn_off_channel/__init__.py deleted file mode 100644 index 8d67c30..0000000 --- a/src/scheduler/jobs/auto_turn_off_channel/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .turn_off import auto_turn_off - -__all__ = ["auto_turn_off"] diff --git a/src/scheduler/jobs/auto_turn_off_channel/constants.py b/src/scheduler/jobs/auto_turn_off_channel/constants.py deleted file mode 100644 index c52bc99..0000000 --- a/src/scheduler/jobs/auto_turn_off_channel/constants.py +++ /dev/null @@ -1,4 +0,0 @@ -# auto turn off channel after 5 errors -ERRORS_LIMIT = 5 - -__all__ = ["ERRORS_LIMIT"] diff --git a/src/scheduler/jobs/auto_turn_off_channel/turn_off.py b/src/scheduler/jobs/auto_turn_off_channel/turn_off.py deleted file mode 100644 index 34ca042..0000000 --- a/src/scheduler/jobs/auto_turn_off_channel/turn_off.py +++ /dev/null @@ -1,16 +0,0 @@ -from .constants import ERRORS_LIMIT -from src.db import DataAccessLayer - - -async def auto_turn_off( - dal: DataAccessLayer, -) -> None: - """ - :param dal: - :return: - """ - - await dal.auto_turn_off_channels(errors_limit=ERRORS_LIMIT) - - -__all__ = ["auto_turn_off"]