I hereby claim:
- I am dfilyushin on github.
- I am dfilyushin (https://keybase.io/dfilyushin) on keybase.
- I have a public key ASDji9Z5RvtYEN1oc1p96aSnxz0Hw3JfjbUhYmWiUfQB7Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import clickhouse_connect | |
import asyncio | |
import multiprocessing | |
import time | |
from datetime import datetime, timedelta | |
from random import randint | |
# Конфигурация подключения к ClickHouse | |
CLICKHOUSE_HOST = 'localhost' | |
CLICKHOUSE_PORT = 8123 |
import clickhouse_connect | |
import asyncio | |
import multiprocessing | |
import time | |
import signal | |
import sys | |
from datetime import datetime, timedelta | |
from random import randint | |
# Конфигурация подключения к ClickHouse |
async def callback_sessions(msg, topic): | |
pass | |
def consumer_factory(): | |
for t in topics: | |
yield AsyncJafkaConsumer(topic=t, ..., callback=partial(callback_sessions, topic=t)) | |
def run(): | |
for c in consumer_factory(): | |
asyncio.ensure_future(c.consume()) |
class EndpointFilter(logging.Filter): | |
def filter(self, record: logging.LogRecord) -> bool: | |
return record.getMessage().find("/endpoint") == -1 | |
# Filter out /endpoint | |
logging.getLogger("uvicorn.access").addFilter(EndpointFilter()) |
wsl --shutdown | |
diskpart | |
# open window Diskpart | |
select vdisk file="C:\WSL-Distros\…\ext4.vhdx" | |
attach vdisk readonly | |
compact vdisk | |
detach vdisk | |
exit |
import asyncio | |
import aio_pika | |
import time | |
import sys | |
async def process_message(message: aio_pika.IncomingMessage): | |
async with message.process(): | |
# worker_name = sys.argv[1] | |
print(message.body, 'queue: result', message.routing_key) |
import asyncio | |
async def run_periodically(wait_time, func, *args): | |
""" | |
Helper for schedule_task_periodically. | |
Wraps a function in a coroutine that will run the | |
given function indefinitely | |
:param wait_time: seconds to wait between iterations of func | |
:param func: the function that will be run | |
:param args: any args that need to be provided to func |