Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/quota/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@
## [__init__.py](__init__.py)
Quota management.

## [cluster_quota_limiter.py](cluster_quota_limiter.py)
Simple cluster quota limiter where quota is fixed for the whole cluster.

## [connect_pg.py](connect_pg.py)
PostgreSQL connection handler.

## [connect_sqlite.py](connect_sqlite.py)
SQLite connection handler.

## [quota_exceed_error.py](quota_exceed_error.py)
Any exception that can occur when a user does not have enough tokens available.

## [quota_limiter.py](quota_limiter.py)
Abstract class that is the parent for all quota limiter implementations.

## [quota_limiter_factory.py](quota_limiter_factory.py)
Quota limiter factory class.

## [revokable_quota_limiter.py](revokable_quota_limiter.py)
Simple quota limiter where quota can be revoked.

## [sql.py](sql.py)
SQL commands used by quota management package.

## [user_quota_limiter.py](user_quota_limiter.py)
Simple user quota limiter where each user has a fixed quota.

6 changes: 3 additions & 3 deletions src/quota/quota_exceed_error.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Any exception that can occur when user does not have enough tokens available."""
"""Any exception that can occur when a user does not have enough tokens available."""

# pylint: disable=line-too-long)
# pylint: disable=line-too-long


class QuotaExceedError(Exception):
"""Any exception that can occur when user does not have enough tokens available."""
"""Any exception that can occur when a user does not have enough tokens available."""

def __init__(
self, subject_id: str, subject_type: str, available: int, needed: int = 0
Expand Down
2 changes: 1 addition & 1 deletion src/quota/quota_limiter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Abstract class that is parent for all quota limiter implementations."""
"""Abstract class that is the parent for all quota limiter implementations."""

from abc import ABC, abstractmethod

Expand Down
2 changes: 1 addition & 1 deletion src/quota/user_quota_limiter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Simple user quota limiter where each user have fixed quota."""
"""Simple user quota limiter where each user has a fixed quota."""

from models.config import QuotaHandlersConfiguration
from log import get_logger
Expand Down
Loading