Skip to content

Commit

Permalink
count function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
HarukaMa committed Feb 27, 2023
1 parent 7b075cc commit 7c5cfe5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions db.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ async def _insert_transition(conn: asyncpg.Connection, exe_tx_db_id: int | None,
transition_finalize_db_id, str(finalize.record)
)

program_db_id = await conn.fetchval(
"SELECT id FROM program WHERE program_id = $1", str(transition.program_id)
)
await conn.execute(
"UPDATE program_function SET called = called + 1 WHERE program_id = $1 AND name = $2",
program_db_id, str(transition.function_name)
)

async def _save_block(self, block: Block):
async with self.pool.acquire() as conn:
async with conn.transaction():
Expand Down

0 comments on commit 7c5cfe5

Please sign in to comment.