Skip to content

Commit

Permalink
add schema off check
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Apr 17, 2024
1 parent 9474a29 commit 9c11a8c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions posthog/temporal/data_imports/external_data_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
ExternalDataJob,
get_active_schemas_for_source_id,
ExternalDataSource,
aget_schema_by_id,
)
from posthog.temporal.common.logger import bind_temporal_worker_logger
from typing import Dict
Expand Down Expand Up @@ -119,6 +120,12 @@ async def check_schedule_activity(inputs: ExternalDataWorkflowInputs) -> bool:
logger.info(f"Deleted schedule for source {inputs.external_data_source_id}")
return True

schema_model = await aget_schema_by_id(inputs.external_data_schema_id, inputs.team_id)

# schema turned off so don't sync
if schema_model and not schema_model.should_sync:
return True

logger.info("Schema ID is set. Continuing...")
return False

Expand Down

0 comments on commit 9c11a8c

Please sign in to comment.