fix important upload
This commit is contained in:
parent
a31a40e690
commit
4bb2d8cf1d
|
|
@ -3,7 +3,7 @@ from base64 import b64decode
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from base58 import b58encode
|
from base58 import b58encode
|
||||||
from sqlalchemy import and_, desc
|
from sqlalchemy import String, and_, desc, cast
|
||||||
from tonsdk.boc import Cell
|
from tonsdk.boc import Cell
|
||||||
from tonsdk.utils import Address
|
from tonsdk.utils import Address
|
||||||
from app.core._config import CLIENT_TELEGRAM_BOT_USERNAME
|
from app.core._config import CLIENT_TELEGRAM_BOT_USERNAME
|
||||||
|
|
@ -227,16 +227,18 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]:
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
|
|
||||||
for hint_message in session.query(KnownTelegramMessage).filter(
|
try:
|
||||||
and_(
|
for hint_message in session.query(KnownTelegramMessage).filter(
|
||||||
KnownTelegramMessage.chat_id == user.telegram_id,
|
and_(
|
||||||
KnownTelegramMessage.type == 'hint',
|
KnownTelegramMessage.chat_id == user.telegram_id,
|
||||||
KnownTelegramMessage.meta['encrypted_content_hash'].astext == encrypted_stored_content.hash,
|
KnownTelegramMessage.type == 'hint',
|
||||||
KnownTelegramMessage.deleted == False
|
cast(KnownTelegramMessage.meta['encrypted_content_hash'], String) == encrypted_stored_content.hash,
|
||||||
)
|
KnownTelegramMessage.deleted == False
|
||||||
).all():
|
)
|
||||||
await user_uploader_wrapper.delete_message(hint_message.message_id)
|
).all():
|
||||||
|
await user_uploader_wrapper.delete_message(hint_message.message_id)
|
||||||
|
except BaseException as e:
|
||||||
|
make_log("Indexer", f"Error while deleting hint messages: {e}" + '\n' + traceback.format_exc(), level="error")
|
||||||
elif encrypted_stored_content.type.startswith('onchain') and encrypted_stored_content.onchain_index == item_index:
|
elif encrypted_stored_content.type.startswith('onchain') and encrypted_stored_content.onchain_index == item_index:
|
||||||
encrypted_stored_content.type = "onchain/content" + ("_unknown" if (encrypted_stored_content.key_id is None) else "")
|
encrypted_stored_content.type = "onchain/content" + ("_unknown" if (encrypted_stored_content.key_id is None) else "")
|
||||||
encrypted_stored_content.owner_address = item_owner_address.to_string(1, 1, 1)
|
encrypted_stored_content.owner_address = item_owner_address.to_string(1, 1, 1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue