Skip to content

refactor(lua): share TTL/disk fallback logic between Lua http and engine disk_cached #322

Description

@Kohei-Wada

Where

  • `ttymap-tui/src/lua/api/http.rs:76` (`LuaJob::spawn` cache logic)
  • `ttymap-engine/src/map/tile/fetch/disk_cached.rs`

What

The "TTL check → disk-immediate-return → fetch → write-through → stale fallback on error" sequence in `LuaJob::spawn` (~50 lines) speaks the same vocabulary as engine's `DiskCachedFetcher` decorator.

Proposal

Pull the cache-decision into a `HttpClient::get_cached(url, ttl)` (or similar) on the engine side. `LuaJob::spawn` keeps only thread + channel wiring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumLong-term maintenancerefactorCode refactoring without behavior change

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions