chore: remove unused env and new create unique task

remove old scheduled tasks approach

update min version

Update __init__.py

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
dni ⚡ 2024-03-22 16:57:22 +01:00
commit 65732f7aa0
No known key found for this signature in database
GPG key ID: 886317704CC4E618
3 changed files with 11 additions and 22 deletions

View file

@ -1,5 +1,4 @@
import json
from asyncio.log import logger
from http import HTTPStatus
from fastapi import Depends, Query, Request
@ -10,7 +9,7 @@ from lnbits.core.crud import get_user
from lnbits.decorators import WalletTypeInfo, check_admin, get_key_type
from lnbits.utils.exchange_rates import currencies, get_fiat_rate_satoshis
from . import lnurlp_ext, scheduled_tasks
from . import lnurlp_ext
from .crud import (
create_pay_link,
delete_lnurlp_settings,
@ -182,17 +181,6 @@ async def api_check_fiat_rate(currency):
return {"rate": rate}
@lnurlp_ext.delete("/api/v1", dependencies=[Depends(check_admin)])
async def api_stop():
for t in scheduled_tasks:
try:
t.cancel()
except Exception as ex:
logger.warning(ex)
return {"success": True}
@lnurlp_ext.get("/api/v1/settings", dependencies=[Depends(check_admin)])
async def api_get_or_create_settings() -> LnurlpSettings:
return await get_or_create_lnurlp_settings()