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