Skip to content

Kill idle connections #288

Kill idle connections

Kill idle connections #288

# Kill idle connections older than 10 minutes
name: Kill idle connections
on:
schedule:
# - cron: '0 */3 * * * ' # every 3 hours
- cron: '0 5 * * *' # every day 5am GMT (12/1am EST/EDT)
workflow_dispatch:
jobs:
kill-idle-cons:
runs-on: ubuntu-latest
steps:
# Set up
- name: Checkout repository and submodules
uses: actions/checkout@v2
- name: Set up Python version
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: 'Create env file'
run: |
mkdir env
echo "${{ secrets.ENV_FILE }}" > env/.env
- name: Create and start virtual environment
run: |
python3 -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel
pip install --upgrade setuptools
pip install -r requirements.txt
# Run the action
- name: Kill idle connections
run: make kill-idle-cons