Hardcode agent stale timeout
This commit is contained in:
@@ -30,7 +30,6 @@ func (s *SettingsStore) Get() (models.Settings, error) {
|
||||
cfg := models.Settings{
|
||||
DefaultWaitSeconds: 10,
|
||||
DefaultEmptyResponse: config.DefaultEmptyResponse,
|
||||
AgentStaleAfterSeconds: 30,
|
||||
}
|
||||
|
||||
for rows.Next() {
|
||||
@@ -43,10 +42,6 @@ func (s *SettingsStore) Get() (models.Settings, error) {
|
||||
if n, err := strconv.Atoi(value); err == nil {
|
||||
cfg.DefaultWaitSeconds = n
|
||||
}
|
||||
case "agent_stale_after_seconds":
|
||||
if n, err := strconv.Atoi(value); err == nil {
|
||||
cfg.AgentStaleAfterSeconds = n
|
||||
}
|
||||
}
|
||||
}
|
||||
return cfg, rows.Err()
|
||||
@@ -57,10 +52,8 @@ func (s *SettingsStore) Get() (models.Settings, error) {
|
||||
func (s *SettingsStore) Update(patch models.Settings) error {
|
||||
_, err := s.db.Exec(`
|
||||
INSERT OR REPLACE INTO settings (key, value) VALUES
|
||||
('default_wait_seconds', ?),
|
||||
('agent_stale_after_seconds', ?)`,
|
||||
('default_wait_seconds', ?)` ,
|
||||
strconv.Itoa(patch.DefaultWaitSeconds),
|
||||
strconv.Itoa(patch.AgentStaleAfterSeconds),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user