Repository: Azure/WALinuxAgent
Pull request #2258 (2021-05-20 23:22:45)

Cleanup history folder every 30 min 

codecov[bot]: # [Codecov](https://codecov.io/gh/Azure/WALinuxAgent/pull/2258?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure) Report
> Merging [#2258](https://codecov.io/gh/Azure/WALinuxAgent/pull/2258?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure) (9928c97) into [develop](https://codecov.io/gh/Azure/WALinuxAgent/commit/694ce7b09f0daa3b066e962d7dd01df107a1aa71?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure) (694ce7b) will **not change** coverage.
> The diff coverage is `0.00%`.

[![Impacted file tree graph](https://codecov.io/gh/Azure/WALinuxAgent/pull/2258/graphs/tree.svg?width=650&height=150&src=pr&token=ae90E2KYCw&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure)](https://codecov.io/gh/Azure/WALinuxAgent/pull/2258?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure)

```diff
@@           Coverage Diff            @@
##           develop    #2258   +/-   ##
========================================
  Coverage    70.82%   70.82%           
========================================
  Files           96       96           
  Lines        13809    13809           
  Branches      1970     1970           
========================================
  Hits          9780     9780           
  Misses        3606     3606           
  Partials       423      423           
```


| [Impacted Files](https://codecov.io/gh/Azure/WALinuxAgent/pull/2258?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure) | Coverage Δ | |
|---|---|---|
| [azurelinuxagent/common/conf.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/2258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure#diff-YXp1cmVsaW51eGFnZW50L2NvbW1vbi9jb25mLnB5) | `77.03% <0.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/Azure/WALinuxAgent/pull/2258?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Azure/WALinuxAgent/pull/2258?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure). Last update [694ce7b...9928c97](https://codecov.io/gh/Azure/WALinuxAgent/pull/2258?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure).


Patch:
diff --git a/README.md b/README.md
index 3785df88..35bd081f 100644
--- a/README.md
+++ b/README.md
@@ -177,7 +177,7 @@ A sample configuration file is shown below:
 ```yml
 Extensions.Enabled=y
 Extensions.GoalStatePeriod=6
-Extensions.GoalStateHistoryCleanupPeriod=86400
+Extensions.GoalStateHistoryCleanupPeriod=1800
 Provisioning.Agent=auto
 Provisioning.DeleteRootPassword=n
 Provisioning.RegenerateSshHostKeyPair=y
diff --git a/azurelinuxagent/common/conf.py b/azurelinuxagent/common/conf.py
index 5b6b9778..67798a47 100644
--- a/azurelinuxagent/common/conf.py
+++ b/azurelinuxagent/common/conf.py
@@ -145,7 +145,7 @@ __STRING_OPTIONS__ = {
 
 __INTEGER_OPTIONS__ = {
     "Extensions.GoalStatePeriod": 6,
-    "Extensions.GoalStateHistoryCleanupPeriod": 86400,
+    "Extensions.GoalStateHistoryCleanupPeriod": 1800,
     "OS.EnableFirewallPeriod": 30,
     "OS.RemovePersistentNetRulesPeriod": 30,
     "OS.RootDeviceScsiTimeoutPeriod": 30,
@@ -346,7 +346,7 @@ def get_goal_state_period(conf=__conf__):
 
 
 def get_goal_state_history_cleanup_period(conf=__conf__):
-    return conf.get_int("Extensions.GoalStateHistoryCleanupPeriod", 86400)
+    return conf.get_int("Extensions.GoalStateHistoryCleanupPeriod", 1800)
 
 
 def get_allow_reset_sys_user(conf=__conf__):
diff --git a/config/waagent.conf b/config/waagent.conf
index 87e201e9..75a79b06 100644
--- a/config/waagent.conf
+++ b/config/waagent.conf
@@ -9,8 +9,8 @@ Extensions.Enabled=y
 # How often (in seconds) to poll for new goal states
 Extensions.GoalStatePeriod=6
 
-# How often (in seconds) to clean up the goal state history. The default value is 24 hrs
-Extensions.GoalStateHistoryCleanupPeriod=86400
+# How often (in seconds) to clean up the goal state history. The default value is 30 min
+Extensions.GoalStateHistoryCleanupPeriod=1800
 
 # Which provisioning agent to use. Supported values are "auto" (default), "waagent",
 # "cloud-init", or "disabled".


Test patch:
diff --git a/tests/test_agent.py b/tests/test_agent.py
index 285710bd..558532f8 100644
--- a/tests/test_agent.py
+++ b/tests/test_agent.py
@@ -35,7 +35,7 @@ DetectScvmmEnv = False
 EnableOverProvisioning = True
 Extension.LogDir = /var/log/azure
 Extensions.Enabled = True
-Extensions.GoalStateHistoryCleanupPeriod = 86400
+Extensions.GoalStateHistoryCleanupPeriod = 1800
 Extensions.GoalStatePeriod = 6
 HttpProxy.Host = None
 HttpProxy.Port = None