Skip to content

Commit

Permalink
Fix auto resize for HA databases
Browse files Browse the repository at this point in the history
  • Loading branch information
otherpirate committed Oct 31, 2016
1 parent 7d824ef commit d0c0e93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dbaas/notification/tasks_disk_resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def zabbix_collect_used_disk(task):
)

for database in Database.objects.filter(environment=environment):
database_resized = False
task.add_detail(
message='Database: {}'.format(database.name), level=1
)
Expand Down Expand Up @@ -91,13 +92,16 @@ def zabbix_collect_used_disk(task):
message='Zabbix metrics not updated', level=4
)

if current_percentage >= threshold_disk_resize and database.disk_auto_resize:
if current_percentage >= threshold_disk_resize and \
database.disk_auto_resize and \
not database_resized:
try:
task_resize = disk_auto_resize(
database=database,
current_size=current_size,
usage_percentage=current_percentage
)
database_resized = True
except Exception as e:
problems += 1
status = TaskHistory.STATUS_WARNING
Expand Down

0 comments on commit d0c0e93

Please sign in to comment.