Skip to content

Commit

Permalink
change heartbeat name
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Nov 22, 2023
1 parent 5d99007 commit e4decfc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions posthog/temporal/batch_exports/backfill_batch_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import temporalio.workflow
from django.conf import settings

from posthog.temporal.common.heartbeat import HeartbeatDetails
from posthog.temporal.common.heartbeat import AsyncHeartbeatDetails
from posthog.batch_exports.service import BackfillBatchExportInputs
from posthog.temporal.common.client import connect
from posthog.temporal.batch_exports.base import PostHogWorkflow
Expand All @@ -31,7 +31,7 @@ def __init__(self, schedule_id: str):
super().__init__(f"The Temporal Schedule {schedule_id} was not found (maybe it was deleted?)")


class BackfillHeartbeatDetails(HeartbeatDetails):
class BackfillHeartbeatDetails(AsyncHeartbeatDetails):
schedule_id: str
start_at: str
end_at: str
Expand Down
2 changes: 1 addition & 1 deletion posthog/temporal/common/heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import datetime as dt


class HeartbeatDetails(typing.NamedTuple):
class AsyncHeartbeatDetails(typing.NamedTuple):
"""Details sent over in a Temporal Activity heartbeat."""

def make_activity_heartbeat_while_running(
Expand Down
4 changes: 2 additions & 2 deletions posthog/temporal/data_imports/external_data_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# TODO: remove dependency
from posthog.temporal.batch_exports.base import PostHogWorkflow
from posthog.temporal.common.heartbeat import HeartbeatDetails
from posthog.temporal.common.heartbeat import AsyncHeartbeatDetails
from temporalio import activity, workflow, exceptions
from temporalio.common import RetryPolicy
from asgiref.sync import sync_to_async
Expand Down Expand Up @@ -108,7 +108,7 @@ async def run_external_data_job(inputs: ExternalDataJobInputs) -> List[SourceSch
)
job_fn = PIPELINE_TYPE_RUN_MAPPING[model.source_type]

heartbeat_details = HeartbeatDetails()
heartbeat_details = AsyncHeartbeatDetails()
func = heartbeat_details.make_activity_heartbeat_while_running(job_fn, dt.timedelta(seconds=10))

return await func(job_inputs)
Expand Down

0 comments on commit e4decfc

Please sign in to comment.