Skip to content

Commit ff28545

Browse files
author
Gabriel Monroy
committed
converge on app scale operation
1 parent 591ba16 commit ff28545

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

api/views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,15 @@ def scale(self, request, **kwargs):
300300
return Response('Invalid scaling format', status=HTTP_400_BAD_REQUEST)
301301
app = self.get_object()
302302
try:
303-
databag = models.Container.objects.scale(app, new_structure)
303+
changed = models.Container.objects.scale(app, new_structure)
304304
except models.ScalingError as e:
305305
return Response(str(e), status=status.HTTP_400_BAD_REQUEST)
306+
if not changed:
307+
return Response(status=status.HTTP_204_NO_CONTENT)
306308
# save new structure now that scaling was successful
307309
app.containers.update(new_structure)
308310
app.save()
311+
databag = app.converge()
309312
return Response(databag, status=status.HTTP_200_OK,
310313
content_type='application/json')
311314

0 commit comments

Comments
 (0)