20260301_client_heartbeat_and_key_rotation_configs.sql 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. -- 客户端心跳与密钥轮换相关配置
  2. -- 心跳失败连续次数超过后暂停检测并退出登录;客户端心跳间隔;密钥轮换检查间隔;密钥轮换连续失败次数超过后退出登录
  3. SET NAMES utf8mb4;
  4. -- 更新已有心跳失败次数默认值为 20(若存在则更新,否则插入)
  5. INSERT INTO `system_config` (
  6. `config_key`,
  7. `config_value`,
  8. `config_type`,
  9. `app_name`,
  10. `description`,
  11. `is_system`,
  12. `is_editable`,
  13. `is_deleted`,
  14. `created_at`,
  15. `updated_at`
  16. ) VALUES
  17. (
  18. 'max_heartbeat_failures',
  19. '20',
  20. 'int',
  21. 'backend-client',
  22. '心跳失败连续次数,超过后暂停检测,客户端退出登录',
  23. 1,
  24. 1,
  25. 0,
  26. NOW(),
  27. NOW()
  28. ),
  29. (
  30. 'client_heartbeat_interval_seconds',
  31. '20',
  32. 'int',
  33. 'backend-client',
  34. '客户端心跳间隔秒数',
  35. 1,
  36. 1,
  37. 0,
  38. NOW(),
  39. NOW()
  40. ),
  41. (
  42. 'key_rotation_check_interval_minutes',
  43. '30',
  44. 'int',
  45. 'backend-client',
  46. '密钥轮换检查间隔分钟数',
  47. 1,
  48. 1,
  49. 0,
  50. NOW(),
  51. NOW()
  52. ),
  53. (
  54. 'max_key_rotation_failures',
  55. '20',
  56. 'int',
  57. 'backend-client',
  58. '密钥轮换连续失败次数,超过后客户端退出登录',
  59. 1,
  60. 1,
  61. 0,
  62. NOW(),
  63. NOW()
  64. )
  65. ON DUPLICATE KEY UPDATE
  66. `config_value` = VALUES(`config_value`),
  67. `description` = VALUES(`description`),
  68. `updated_at` = NOW();