Hook db connection when you're running a long term sleep crawler assignment.
Project description
Flask Database Pacemaker
python_requires>=3.6
Flask>=1.0.2
Flask-APScheduler>=1.11.0
Flask-SQLAlchemy>=2.3.2
- How to use
- Set confing.py
MODELS_PATH_LIST
is required
POKE_DB_INTERVAL
default value which is one hour
MODELS_PATH_LIST = ['model_path.models']
POKE_DB_INTERVAL = 60 * 60 # seconds
- Import package at
app.py
from flask_dbpacemaker import DBPacemaker
- Append this after you declare
config
andapp
DBPacemaker.run(app=app, config=config, display=True)
- If you have a exist scheduler, you have to add it like this.
DBPacemaker.run(app, config, True, secheduler=secheduler)
Note: The job permanent trigger is 'interval'
.
Cheers!🎉
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Flask-DBPacemaker-1.1.0.tar.gz
.
File metadata
- Download URL: Flask-DBPacemaker-1.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c53cf0ccce4e512df2440f3398d8e7ca16e0d6528ad6cccfda73abcc96c60c2 |
|
MD5 | 3be6672302f34dd0b16a990c8cd462d7 |
|
BLAKE2b-256 | dd7c51db722b34d7c5e4ba0faaca13145ddce6837e572333c8cb63b2df6b4775 |