Skip to content

Commit 7eacb0f

Browse files
committed
fix(timeouts): timeouts set error
1 parent edfeef9 commit 7eacb0f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

rootfs/api/models/config.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,18 @@ def _update_limits(self, previous_config, replace_ptypes=[]):
265265
"the %s has already been used and cannot be deleted" % ptype)
266266
self._merge_data('limits', data, new_data)
267267
setattr(self, 'limits', data)
268+
269+
def _update_termination_grace_period(self, previous_config, replace_ptypes=[]):
270+
data = {
271+
k: v for k, v in getattr(previous_config, 'termination_grace_period', {}).copy().items()
272+
if k not in replace_ptypes
273+
}
274+
new_data = getattr(self, 'termination_grace_period', {}).copy()
275+
# check procfile
276+
for ptype, value in new_data.items():
277+
if value is None:
278+
if ptype in self.app.ptypes:
279+
raise UnprocessableEntity(
280+
"the %s has already been used and cannot be deleted" % ptype)
281+
self._merge_data('termination_grace_period', data, new_data)
282+
setattr(self, 'termination_grace_period', data)

0 commit comments

Comments
 (0)