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
4 changes: 2 additions & 2 deletions src/quota/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
UPDATE quota_limits
SET available=available+?, revoked_at=datetime('now')
WHERE subject=?
AND revoked_at < datetime('now', ?);
AND datetime(revoked_at, ?) <= datetime('now');
"""


Expand All @@ -54,7 +54,7 @@
UPDATE quota_limits
SET available=?, revoked_at=datetime('now')
WHERE subject=?
AND revoked_at < datetime('now', ?);
AND datetime(revoked_at, ?) <= datetime('now');
"""

INIT_QUOTA_PG = """
Expand Down
4 changes: 3 additions & 1 deletion src/runners/quota_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ def quota_revocation(

subject_id = get_subject_id(quota_limiter.type)

if quota_limiter.quota_increase is not None:
# do not update quota revocation date when the increase is set to zero
if quota_limiter.quota_increase is not None and quota_limiter.quota_increase > 0:
increase_quota(
connection,
increase_quota_statement,
Expand All @@ -226,6 +227,7 @@ def quota_revocation(
quota_limiter.period,
)

# do not update quota revocation date when the initial quota is set to zero
if quota_limiter.initial_quota is not None and quota_limiter.initial_quota > 0:
reset_quota(
connection,
Expand Down
Loading