ClimateMisinformation / Scrapers

Web scrapers
5 stars 1 forks source link

Graceful shutdown to docanno application #11

Closed ricjhill closed 3 years ago

ricjhill commented 3 years ago

Add graceful shutdown to docanno application. I want to stop and start and restart without fear of data loss or cache corruption. Confirm it can be done. Possibly push the solution upstream to docanno

ricjhill commented 3 years ago

If I ssh into the VM running doccano with a root based account I can stop and start the docker container without losing data.

ricjhill commented 3 years ago

Making staticfiles Initializing database Operations to perform: Apply all migrations: admin, api, auth, authtoken, contenttypes, sessions, social_django Running migrations: No migrations to apply. Your models have changes that are not yet reflected in a migration, and so won't be applied. Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them. Creating admin Starting django [2020-12-20 19:56:14 +0000] [14] [INFO] Starting gunicorn 19.9.0 [2020-12-20 19:56:14 +0000] [14] [INFO] Listening at: http://0.0.0.0:8000 (14) [2020-12-20 19:56:14 +0000] [14] [INFO] Using worker: sync /usr/local/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used return io.open(fd, *args, kwargs) [2020-12-20 19:56:14 +0000] [16] [INFO] Booting worker with pid: 16 /usr/local/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used return io.open(fd, *args, *kwargs) [2020-12-20 19:56:15 +0000] [17] [INFO] Booting worker with pid: 17 Making staticfiles Initializing database Operations to perform: Apply all migrations: admin, api, auth, authtoken, contenttypes, sessions, social_django Running migrations: No migrations to apply. Your models have changes that are not yet reflected in a migration, and so won't be applied. Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them. Creating admin Starting django [2020-12-20 20:06:15 +0000] [14] [INFO] Starting gunicorn 19.9.0 [2020-12-20 20:06:15 +0000] [14] [INFO] Listening at: http://0.0.0.0:8000 (14) [2020-12-20 20:06:15 +0000] [14] [INFO] Using worker: sync /usr/local/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used return io.open(fd, args, kwargs) [2020-12-20 20:06:15 +0000] [16] [INFO] Booting worker with pid: 16 /usr/local/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used return io.open(fd, *args, **kwargs) [2020-12-20 20:06:15 +0000] [17] [INFO] Booting worker with pid: 17

ricjhill commented 3 years ago

Which synchs with this from https://github.com/doccano/doccano/blob/master/README.md

To stop the container, run docker container stop doccano -t 5. All data created in the container will persist across restarts.