Skip to content

Backend: Set timeout fields in DB during agent config update

MR: Set timeout fields on agent config model (!158383 - merged)

Description

During agent config update, set default_max_hours_before_termination and max_hours_before_termination_limit. If the values are not present, use 24 and 120 hours respectively.

Acceptance Criteria

  • The default value for default_max_hours_before_termination comes from here and the minimum value is 1. It should also be <= max_hours_before_termination_limit of the agent config.
  • The default value for max_hours_before_termination_limit comes from here and the minimum value is 1. It should also be >= default_max_hours_before_termination of the agent config.
  • Add appropriate validations to the model. In addition to the above minimum of 1, there should be a maximum of 8760, because this is the max value for a workspace PAT lifetime see:Workspaces: Rotate PAT injected into a workspace (#471994)
Edited by Safwan Ahmed