Compare commits

..

5 Commits

Author SHA1 Message Date
Ivan Vazhenin
5d5be67efc fix 2022-04-12 19:50:29 +03:00
Petr Sloup
aba60f0c6a Merge pull request #560 from zstadler/docker-reload
Simplify reloading the configuration with docker
2021-12-29 09:42:16 +01:00
zstadler
6027d89623 Simplify reloading the configuration with docker
Allow `docker kill -s HUP` and `docker-compose kill -s HUP` to reach the
node process.
2021-12-22 18:38:44 +02:00
Petr Sloup
8680a8006a Merge pull request #516 from zstadler/patch-1
Document configuration reloading when using docker
2021-07-28 13:14:31 +02:00
zstadler
09ded526ef Document configuration reloading when using docker
Based on https://github.com/maptiler/tileserver-gl/issues/420#issuecomment-766332814
2021-02-02 12:35:19 +02:00
3 changed files with 23 additions and 2 deletions

View File

@@ -10,6 +10,14 @@ handle() {
trap handle INT TERM
refresh() {
SIGNAL=$(( $? - 128 ))
echo "Caught signal ${SIGNAL}, refreshing"
kill -s ${SIGNAL} $(pidof node) 2>/dev/null
}
trap refresh HUP
if ! which -- "${1}"; then
# first arg is not an executable
xvfb-run -a --server-args="-screen 0 1024x768x24" -- node /app/ "$@" &

View File

@@ -29,8 +29,10 @@ Default preview style and configuration
- If no configuration file is specified, a default preview style (compatible with openmaptiles) is used.
- If no mbtiles file is specified (and is not found in the current working directory), a sample file is downloaded (showing the Zurich area)
Reloading configuration
Reloading the configuration
======
It is possible to reload the configuration file without restarting the whole process by sending a SIGHUP signal to the node process.
However, this does not currently work when running the tileserver-gl docker container (the signal is not passed to the subprocess, see https://github.com/maptiler/tileserver-gl/issues/420#issuecomment-597507663).
- The `docker kill -s HUP tileserver-gl` command can be used when running the tileserver-gl docker container.
- The `docker-compose -s HUP tileserver-gl-service-name` can be used when tileserver-gl is run as a docker-compose service.

View File

@@ -256,6 +256,17 @@ function start(opts) {
res.send(result);
});
app.get('/process', (req, res, next) => {
const result = {};
const id = req.query.style || '';
const item = {
'style': id + '.json'
};
result[id] = true;
addStyle(id, item, true, true);
res.send(serving.styles);
});
const addTileJSONs = (arr, req, type) => {
for (const id of Object.keys(serving[type])) {
const info = clone(serving[type][id].tileJSON);