Code Room
Code reviewMedium
Question
Review this Python asyncio code that records audit events.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
import asyncio async def write_audit(event): await db.execute("INSERT INTO audit VALUES ($1)", event) async def handle_request(req): result = await process(req) asyncio.create_task(write_audit(req.id)) # log in background return result async def main(): for req in incoming(): await handle_request(req)Run or narrate your approach, then ask the coach.