Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix a small bug
Browse files Browse the repository at this point in the history
flxdot committed May 1, 2024

Verified

This commit was signed with the committer’s verified signature.
sandy081 Sandeep Somavarapu
1 parent 73c0a0f commit 0f2ada1
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/py_edge_device/carlos/edge/device/runtime.py
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ async def _send_pending_data(self):
async with get_async_storage_engine().connect() as connection:
staged_data = await stage_timeseries_data(connection=connection)

if staged_data is not None:
if staged_data is None:
logger.debug("No data available to be staged.")
return

Original file line number Diff line number Diff line change
@@ -99,6 +99,9 @@ async def stage_timeseries_data(
)
sample_ids = (await connection.execute(sample_ids_query)).scalars().all()

if not sample_ids:
return None

stage_stmt = (
update(TimeseriesDataOrm)
.values(
@@ -122,9 +125,6 @@ async def stage_timeseries_data(
)
staged_rows = (await connection.execute(staged_query)).all()

if not staged_rows:
return None

for row in staged_rows:
if row.timeseries_id not in payload.data:
payload.data[row.timeseries_id] = DriverTimeseries(

0 comments on commit 0f2ada1

Please sign in to comment.