2022-09-15 13:14:55 +02:00
|
|
|
from fittrackee.utils import clean
|
2022-06-12 18:25:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
def clean_tokens(days: int) -> int:
|
|
|
|
sql = """
|
|
|
|
DELETE FROM oauth2_token
|
2023-10-04 15:25:26 +02:00
|
|
|
WHERE oauth2_token.issued_at + oauth2_token.expires_in < %(limit)s;
|
2022-06-12 18:25:51 +02:00
|
|
|
"""
|
2022-09-15 13:14:55 +02:00
|
|
|
return clean(sql, days)
|