stars fixes
This commit is contained in:
parent
10cb581b34
commit
79593f1e75
|
|
@ -86,13 +86,13 @@ async def s_api_v1_content_view(request, content_address: str):
|
||||||
StarsInvoice.user_id == request.ctx.user.id,
|
StarsInvoice.user_id == request.ctx.user.id,
|
||||||
StarsInvoice.created > datetime.now() - timedelta(minutes=25),
|
StarsInvoice.created > datetime.now() - timedelta(minutes=25),
|
||||||
StarsInvoice.amount == stars_cost,
|
StarsInvoice.amount == stars_cost,
|
||||||
StarsInvoice.external_id == invoice_id
|
StarsInvoice.content_hash == content['encrypted_content'].hash,
|
||||||
)
|
)
|
||||||
).first()
|
).first()
|
||||||
if exist_invoice:
|
if exist_invoice:
|
||||||
invoice_url = exist_invoice.invoice_url
|
invoice_url = exist_invoice.invoice_url
|
||||||
else:
|
else:
|
||||||
invocie_url = None
|
invoice_url = None
|
||||||
try:
|
try:
|
||||||
invoice_url = await Bot(token=CLIENT_TELEGRAM_API_KEY).create_invoice_link(
|
invoice_url = await Bot(token=CLIENT_TELEGRAM_API_KEY).create_invoice_link(
|
||||||
'Lifetime access to content',
|
'Lifetime access to content',
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ async def license_index_loop(memory, platform_found: bool, seqno: int) -> [bool,
|
||||||
async def check_telegram_stars_transactions():
|
async def check_telegram_stars_transactions():
|
||||||
# Проверка звездных telegram транзакций, обновление paid
|
# Проверка звездных telegram транзакций, обновление paid
|
||||||
offset = {'desc': 'Статичное число заранее известного количества транзакций, которое даже не знает наш бот', 'value': 1}['value'] + \
|
offset = {'desc': 'Статичное число заранее известного количества транзакций, которое даже не знает наш бот', 'value': 1}['value'] + \
|
||||||
session.query(StarsInvoice).count()
|
0 # session.query(StarsInvoice).count()
|
||||||
limit = 100
|
limit = 100
|
||||||
while True:
|
while True:
|
||||||
make_log("StarsProcessing", f"Star payments: offset={offset}, limit={limit}", level="DEBUG")
|
make_log("StarsProcessing", f"Star payments: offset={offset}, limit={limit}", level="DEBUG")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue