Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | # Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style |
| 3 | # license that can be found in the LICENSE file or at |
| 4 | # https://developers.google.com/open-source/licenses/bsd |
| 5 | |
| 6 | """A class to handle the initial warmup request from AppEngine.""" |
| 7 | from __future__ import print_function |
| 8 | from __future__ import division |
| 9 | from __future__ import absolute_import |
| 10 | |
| 11 | import logging |
| 12 | |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 13 | |
Adrià Vilanova Martínez | 9f9ade5 | 2022-10-10 23:20:11 +0200 | [diff] [blame^] | 14 | def Warmup(): |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 15 | """Placeholder for warmup work. Used only to enable min_idle_instances.""" |
Adrià Vilanova Martínez | 9f9ade5 | 2022-10-10 23:20:11 +0200 | [diff] [blame^] | 16 | # Don't do anything that could cause a jam when many instances start. |
| 17 | logging.info('/_ah/startup does nothing in Monorail.') |
| 18 | logging.info('However it is needed for min_idle_instances in app.yaml.') |
| 19 | return '' |
Adrià Vilanova Martínez | de94280 | 2022-07-15 14:06:55 +0200 | [diff] [blame] | 20 | |
| 21 | |
Adrià Vilanova Martínez | 9f9ade5 | 2022-10-10 23:20:11 +0200 | [diff] [blame^] | 22 | def Start(): |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 23 | """Placeholder for start work. Used only to enable manual_scaling.""" |
Adrià Vilanova Martínez | 9f9ade5 | 2022-10-10 23:20:11 +0200 | [diff] [blame^] | 24 | # Don't do anything that could cause a jam when many instances start. |
| 25 | logging.info('/_ah/start does nothing in Monorail.') |
| 26 | logging.info('However it is needed for manual_scaling in app.yaml.') |
| 27 | return '' |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 28 | |
Adrià Vilanova Martínez | de94280 | 2022-07-15 14:06:55 +0200 | [diff] [blame] | 29 | |
Adrià Vilanova Martínez | 9f9ade5 | 2022-10-10 23:20:11 +0200 | [diff] [blame^] | 30 | def Stop(): |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 31 | """Placeholder for stop work. Used only to enable manual_scaling.""" |
Adrià Vilanova Martínez | 9f9ade5 | 2022-10-10 23:20:11 +0200 | [diff] [blame^] | 32 | # Don't do anything that could cause a jam when many instances start.""" |
| 33 | logging.info('/_ah/stop does nothing in Monorail.') |
| 34 | logging.info('However it is needed for manual_scaling in app.yaml.') |
| 35 | return '' |