Skip to content

Improve refund policy#84

Merged
Deniskore merged 1 commit into
mainfrom
sn-376-improve-refund-policy
May 11, 2026
Merged

Improve refund policy#84
Deniskore merged 1 commit into
mainfrom
sn-376-improve-refund-policy

Conversation

@Deniskore

@Deniskore Deniskore commented May 11, 2026

Copy link
Copy Markdown
Collaborator
  1. Split gateway task timeout from result retention with new taskmanager_task_lifetime.
  2. Set workers default task deadline to 10 minutes and in-memory result retention to 5 minutes.
  3. Use task lifetime, not result lifetime, for DB generation task deadlines.

@Deniskore Deniskore requested a review from the-mx May 11, 2026 07:57
@Deniskore Deniskore force-pushed the sn-376-improve-refund-policy branch from 1dec2d1 to 4bfc211 Compare May 11, 2026 08:30
@Deniskore Deniskore requested a review from Copilot May 11, 2026 08:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR separates “task deadline/timeout” from “in-memory result retention” by introducing a distinct taskmanager_task_lifetime alongside the existing taskmanager_result_lifetime, and wires these through config, DB settings, and the TaskManager so runtime settings can adjust them independently.

Changes:

  • Added task-vs-result lifetimes to config + DB app_settings, with new defaults (task: 10m, results: 5m).
  • Updated TaskManager to track task/result lifetimes separately and allow updating them at runtime.
  • Updated task deadline calculation for DB generation tasks to use task lifetime (not result lifetime) and adjusted tests/harnesses accordingly.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/event_tracker/worker.rs Updates test harness options to set task lifetime for timeout behavior.
tests/event_tracker/support.rs Extends runtime settings updates to include task/result lifetime columns.
tests/common/real_harness.rs Adds task lifetime option + seeds new lifetime columns into app_settings.
tests/client_http_api/support.rs Includes new lifetime fields when updating gateway runtime settings.
tests/client_http_api/generic_rate_limits.rs Switches end-to-end timeout behavior to task lifetime.
src/test_support.rs Passes task_lifetime into TaskManagerInit when building shared harness core.
src/task/tests.rs Adds coverage for lifetime updates + updates struct literals for new init field.
src/task/mod.rs Implements separate task/result lifetimes (atomics) + runtime update API.
src/raft/tests/cross_gateway_add_task.rs Passes configured task lifetime into TaskManagerInit in raft tests.
src/raft/rate_limit/engine.rs Constructs TaskManager with explicit task lifetime in tests.
src/raft/mod.rs Reorders settings updater spawn to provide TaskManager for runtime lifetime updates.
src/raft/gateway_state.rs Exposes task/result lifetime accessors from DB settings or config fallback.
src/http3/handlers/task/add_task.rs Uses task lifetime for generation-task DB deadline calculation.
src/db/gateway_settings.rs Adds lifetime fields to cached settings + pushes runtime updates into TaskManager.
src/db/data_access.rs Adds new app_settings columns to gateway settings row decode + SELECT.
src/config.rs Adds taskmanager_task_lifetime with defaults; adds default for result lifetime.
dev-env/init-scripts/init-schema.sql Adds app_settings columns + defaults and seeds initial row values.
dev-env/config/config1.toml Updates dev config to use new lifetime split and defaults.
dev-env/config/config2.toml Updates dev config to use new lifetime split and defaults.
dev-env/config/config3.toml Updates dev config to use new lifetime split and defaults.
dev-env/config/config-single.toml Updates dev config to use new lifetime split and defaults.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/db/gateway_settings.rs Outdated
Comment thread src/task/tests.rs
@Deniskore Deniskore force-pushed the sn-376-improve-refund-policy branch from 4bfc211 to c23b669 Compare May 11, 2026 08:58
@Deniskore Deniskore requested a review from Copilot May 11, 2026 09:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.

@Deniskore Deniskore merged commit 160c356 into main May 11, 2026
12 checks passed
@Deniskore Deniskore deleted the sn-376-improve-refund-policy branch May 11, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants