Skip to content

Commit 2668bc6

Browse files
committed
put grouped async code back in
1 parent 25ac517 commit 2668bc6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

solar_consumer/save/save_data_platform.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,17 @@ async def save_generation_to_data_platform(
382382
new_effective_capacity_watts=new_cap,
383383
valid_from_utc=t,
384384
)
385-
_ = await client.update_location(req)
386-
# tasks.append(asyncio.create_task(client.update_location(req)))
385+
# TODO if we run the next line, the tests seem to pass
386+
# _ = await client.update_location(req)
387+
######## code that doesnt work (maybe)
388+
tasks.append(asyncio.create_task(client.update_location(req)))
387389

388-
# if len(tasks) > 0:
389-
# logging.info("updating %d %s location capacities", len(tasks), country.upper())
390-
# # NL was previously ignoring these exceptions
391-
# await _execute_async_tasks(tasks, ignore_exceptions=False)
390+
if len(tasks) > 0:
391+
logging.info("updating %d %s location capacities", len(tasks), country.upper())
392+
# NL was previously ignoring these exceptions
393+
await _execute_async_tasks(tasks, ignore_exceptions=False)
394+
395+
######## code that doesnt work (maybe)
392396

393397
# 3. Generate the CreateObservationRequest objects from the DataFrame.
394398
observations_by_loc: dict[str, list[dp.CreateObservationsRequestValue]] = defaultdict(list)

0 commit comments

Comments
 (0)