mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-24 14:19:05 +00:00
dont always enable hatchet (#809)
* dont always enable hatchet * fix hatchet worker params --------- Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
This commit is contained in:
@@ -7,7 +7,7 @@ Spawned dynamically by detect_topics via aio_run_many() for parallel processing.
|
|||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from hatchet_sdk import ConcurrencyExpression, Context
|
from hatchet_sdk import ConcurrencyExpression, ConcurrencyLimitStrategy, Context
|
||||||
from hatchet_sdk.rate_limit import RateLimit
|
from hatchet_sdk.rate_limit import RateLimit
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
@@ -37,6 +37,7 @@ topic_chunk_workflow = hatchet.workflow(
|
|||||||
concurrency=ConcurrencyExpression(
|
concurrency=ConcurrencyExpression(
|
||||||
expression="true", # constant CEL expression = global limit
|
expression="true", # constant CEL expression = global limit
|
||||||
max_runs=20,
|
max_runs=20,
|
||||||
|
limit_strategy=ConcurrencyLimitStrategy.GROUP_ROUND_ROBIN,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -188,8 +188,8 @@ async def dispatch_transcript_processing(
|
|||||||
room_forces_hatchet = room.use_hatchet if room else False
|
room_forces_hatchet = room.use_hatchet if room else False
|
||||||
|
|
||||||
# Start durable workflow if enabled (Hatchet)
|
# Start durable workflow if enabled (Hatchet)
|
||||||
# or if room has use_hatchet=True
|
# and if room has use_hatchet=True
|
||||||
use_hatchet = settings.HATCHET_ENABLED or room_forces_hatchet
|
use_hatchet = settings.HATCHET_ENABLED and room_forces_hatchet
|
||||||
|
|
||||||
if room_forces_hatchet:
|
if room_forces_hatchet:
|
||||||
logger.info(
|
logger.info(
|
||||||
|
|||||||
@@ -287,9 +287,7 @@ async def _process_multitrack_recording_inner(
|
|||||||
room_id=room.id,
|
room_id=room.id,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Start durable workflow if enabled (Hatchet) or room overrides it
|
use_hatchet = settings.HATCHET_ENABLED and room and room.use_hatchet
|
||||||
durable_started = False
|
|
||||||
use_hatchet = settings.HATCHET_ENABLED or (room and room.use_hatchet)
|
|
||||||
|
|
||||||
if room and room.use_hatchet and not settings.HATCHET_ENABLED:
|
if room and room.use_hatchet and not settings.HATCHET_ENABLED:
|
||||||
logger.info(
|
logger.info(
|
||||||
@@ -836,7 +834,7 @@ async def reprocess_failed_daily_recordings():
|
|||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
use_hatchet = settings.HATCHET_ENABLED or (room and room.use_hatchet)
|
use_hatchet = settings.HATCHET_ENABLED and room and room.use_hatchet
|
||||||
|
|
||||||
if use_hatchet:
|
if use_hatchet:
|
||||||
# Hatchet requires a transcript for workflow_run_id tracking
|
# Hatchet requires a transcript for workflow_run_id tracking
|
||||||
|
|||||||
Reference in New Issue
Block a user