take snapshot at 12 localtime

This commit is contained in:
simon 2022-11-02 10:17:27 +07:00
parent 238c6bc080
commit 749261c146
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -107,8 +107,11 @@ class ElasticSnapshot:
def _build_policy_data(self):
"""build policy dict from config"""
at_12 = datetime.now().replace(hour=12, minute=0, second=0)
hour = at_12.astimezone(ZoneInfo("UTC")).hour
return {
"schedule": "0 30 1 * * ?",
"schedule": f"0 0 {hour} * * ?",
"name": f"<{self.POLICY}_>",
"repository": self.REPO,
"config": {