(20260623) Migrate to new server.

This commit is contained in:
2026-06-23 17:12:19 +05:30
parent 1ec1c0a4ec
commit 4d2f824593
2 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -41,7 +41,7 @@ import os
# Utils: # Utils:
from utils_v2.string import json from utils_v2.string import json
from utils_v2.date_time import date_time from utils_v2.date_time import date_time
from utils_v2.queue.async_kafka import ProducerKafka, ConsumerKafka, get_ssl_context from utils_v2.queue.kafka.controllers.async_kafka import ProducerKafka, ConsumerKafka, get_ssl_context
# For async activities: # For async activities:
import asyncio import asyncio
@@ -134,7 +134,8 @@ if __name__ == "__main__":
while True: while True:
await asyncio.sleep(1.0) await asyncio.sleep(1.0)
messages = await my_consumer.consume(count = 10, timeout = 1.0) messages = await my_consumer.consume(count = 10, timeout = 1.0)
for message in messages: print("MESSAGE:", json.to_string(message["value"])) # for message in messages: print("MESSAGE:", json.to_string(message["value"]))
for message in messages: print("MESSAGE:", json.to_string(message.value))
async def main(): async def main():
await asyncio.gather(*[keep_producing(), keep_consuming()]) await asyncio.gather(*[keep_producing(), keep_consuming()])
+3 -3
View File
@@ -39,9 +39,9 @@ sys.path.append("..")
from pydantic import BaseModel, Field, field_validator, model_validator, AwareDatetime from pydantic import BaseModel, Field, field_validator, model_validator, AwareDatetime
from typing import Optional, Literal, Union, Dict, List, Any from typing import Optional, Literal, Union, Dict, List, Any
# Related to Google: # # Related to Google:
from google.auth.transport.requests import Request # from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials # from google.oauth2.credentials import Credentials
# My utils: # My utils:
from utils_v2.string import json from utils_v2.string import json