Merge pull request #42 from lnbits/remove-env
chore: remove unused env and new create unique task
This commit is contained in:
commit
7194ab60f1
3 changed files with 11 additions and 22 deletions
14
views_api.py
14
views_api.py
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue