Skip to content

Commit d0c0e93

Browse files
committed
Fix auto resize for HA databases
1 parent 7d824ef commit d0c0e93

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dbaas/notification/tasks_disk_resize.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def zabbix_collect_used_disk(task):
3535
)
3636

3737
for database in Database.objects.filter(environment=environment):
38+
database_resized = False
3839
task.add_detail(
3940
message='Database: {}'.format(database.name), level=1
4041
)
@@ -91,13 +92,16 @@ def zabbix_collect_used_disk(task):
9192
message='Zabbix metrics not updated', level=4
9293
)
9394

94-
if current_percentage >= threshold_disk_resize and database.disk_auto_resize:
95+
if current_percentage >= threshold_disk_resize and \
96+
database.disk_auto_resize and \
97+
not database_resized:
9598
try:
9699
task_resize = disk_auto_resize(
97100
database=database,
98101
current_size=current_size,
99102
usage_percentage=current_percentage
100103
)
104+
database_resized = True
101105
except Exception as e:
102106
problems += 1
103107
status = TaskHistory.STATUS_WARNING

0 commit comments

Comments
 (0)