SShortSingh.
Back to feed

Engineer fixes AI bot timeout by building a resumable, self-healing data cache

0
·1 views

A software engineer discovered his AI algorithmic trading bot was silently failing because fetching data for 250 stock tickers took roughly 700 seconds, exceeding his execution environment's 600-second hard timeout. The root cause traced back to a scaling oversight: during development he tested with only 10 tickers, never calculating the total runtime needed for full production load. Standard caching could not solve the problem alone, since any crash before completion wiped partially fetched data from memory, forcing a full restart each time. His fix was a self-healing cache that writes progress to disk every 50 tickers using Python's pickle format, so subsequent runs skip already-fetched tickers and only call the API for missing ones. By repeating this incremental approach across multiple runs, the complete cache for all 250 tickers is eventually built regardless of how many timeouts occur.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Only 130 of Thousands of AI 'Agent' Vendors Actually Build Real Agents, Gartner Finds

A 2025 Gartner review found that only around 130 vendors out of thousands claiming 'agentic' capability were building systems that genuinely qualify as AI agents. The core technical distinction, drawn by Anthropic, separates workflows — where predefined code controls each step — from true agents, where the AI model itself dynamically decides what actions to take. A real AI agent requires five components: a reasoning model, tools to act on the world, short- and long-term memory, a decision-execute loop, and a hard limit to prevent runaway execution. The widespread misuse of the term 'agent' in marketing has made it nearly impossible to evaluate products without understanding this technical definition. The piece argues that reliability challenges, guardrails, and monitoring requirements all stem directly from the agent's core property of autonomous, variable decision-making.

0
ProgrammingDEV Community ·

How a 12-Agent AI Fleet Solved Persistent Memory Loss Across Runs

Empire Labs built and runs a fleet of twelve autonomous AI agents in production that handle tasks such as lead generation, compliance monitoring, and code review. A critical incident occurred when an agent lost track of an external submission it had made, with no durable record surviving after its session ended. The team identified three core gaps: lack of durable state storage, no recall path for past sessions, and no enforced discipline for writing state at the moment of action. To fix this, they developed a four-layer memory architecture that separates hot in-prompt memory from persistent per-thread state files stored on disk. The system allows any agent to resume a workflow days later with full context on where things stand and what needs to happen next.

0
ProgrammingHacker News ·

How an Old Phone Book Helped Expose Syria's Spy Chief in Hiding

Journalists investigating Syria's intelligence apparatus used an old phone book as a key lead to locate a senior Assad regime spy chief who had gone into hiding. The investigation, reported by the BBC, highlights how open-source and traditional research methods can uncover individuals evading accountability. The target was a high-ranking figure within Assad's security services, which have been widely accused of overseeing torture and repression. The find underscores ongoing efforts by reporters and investigators to track former regime officials following the collapse of Assad's government. The case demonstrates how low-tech documents can still play a critical role in modern investigative journalism.

0
ProgrammingDEV Community ·

Cognizant GenC 2025-26 Campus Hiring: Full Process Breakdown by a Selected Candidate

A MERN stack developer shared a detailed first-hand account of Cognizant's GenC on-campus hiring process for the 2025-26 cycle, which spanned roughly three and a half months from November 2025 to late February 2026. The process consisted of multiple proctored assessments, including an English communication test, an aptitude test on the Aon platform, and a 120-minute technical assessment covering Java, SQL, HTML, CSS, and JavaScript. The technical round featured practical coding and query-writing tasks rather than purely multiple-choice questions, with strict one-way navigation that prevented candidates from revisiting earlier questions. Shortlisted candidates then faced a one-on-one video interview on the Superset platform covering projects, core Java, SQL, computer science fundamentals, and HR scenarios. The GenC role falls under the Information Technology track and offers a package ranging from ₹4.0 LPA to ₹6.75 LPA.