Files
Fulfillment-Backend/test.py
2024-09-02 19:19:41 +03:00

55 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# import asyncio
#
# from dict_hash import dict_hash
# from sqlalchemy.ext.asyncio import AsyncSession
#
# from backend.session import session_maker
# from marketplaces import MarketplaceControllerFactory
# from models import Marketplace
# import pickle
# pickle.dumps()
#
# async def main():
# a = "example"
# b = "example"
#
# print(hash(a)) # Хэш для строки "example"
# print(hash(b)) # Хэш для строки "example", будет таким же как и у a
#
# return
# session: AsyncSession = session_maker()
#
# try:
# mp = await session.get(Marketplace, 2)
# if not mp:
# return
# c = MarketplaceControllerFactory.get_controller(session, mp)
# await c.synchronize_products()
# finally:
# await session.close()
#
#
# if __name__ == '__main__':
# loop = asyncio.get_event_loop()
# loop.run_until_complete(main())
import hashlib
import time
from reportlab.rl_settings import autoGenerateMissingTTFName
from decorators.locking import lock, redis_client
@lock('synchronize_marketplace', include_args_in_key=True)
def test(marketplace_id: int):
print("test")
time.sleep(100)
def main():
test(1)
if __name__ == '__main__':
main()