mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-03-17 21:31:52 +01:00
stricter checks for subscription
This commit is contained in:
parent
f3a6a7caf0
commit
565526145a
@ -383,6 +383,9 @@ class Subscription:
|
||||
|
||||
async def handle_subscription_renewal(subscription):
|
||||
zaps = json.loads(subscription.zaps)
|
||||
|
||||
|
||||
|
||||
success = await pay_zap_split(subscription.nwc, subscription.amount, zaps, subscription.tier,
|
||||
subscription.unit)
|
||||
if success:
|
||||
@ -393,6 +396,7 @@ class Subscription:
|
||||
else:
|
||||
end = Timestamp.now().as_secs()
|
||||
recipe = subscription.recipe
|
||||
delete_from_subscription_sql_table(dvm_config.DB, subscription.id)
|
||||
|
||||
update_subscription_sql_table(dvm_config.DB, subscription.id,
|
||||
subscription.recipent,
|
||||
@ -421,6 +425,12 @@ class Subscription:
|
||||
subscriptions = get_all_subscriptions_from_sql_table(dvm_config.DB)
|
||||
|
||||
for subscription in subscriptions:
|
||||
|
||||
|
||||
if subscription.nwc == "":
|
||||
delete_from_subscription_sql_table(dvm_config.DB, subscription.id)
|
||||
|
||||
|
||||
if subscription.active:
|
||||
if subscription.end < Timestamp.now().as_secs():
|
||||
# We could directly zap, but let's make another check if our subscription expired
|
||||
|
2
setup.py
2
setup.py
@ -1,6 +1,6 @@
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
VERSION = '0.8.17'
|
||||
VERSION = '0.8.18'
|
||||
DESCRIPTION = 'A framework to build and run Nostr NIP90 Data Vending Machines'
|
||||
LONG_DESCRIPTION = ('A framework to build and run Nostr NIP90 Data Vending Machines. See the github repository for more information')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user