-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:jhu-bids/TermHub into develop
- Loading branch information
Showing
9 changed files
with
231 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Kill idle connections older than 10 minutes | ||
name: Kill idle connections | ||
|
||
on: | ||
schedule: | ||
- cron: '0 */3 * * * ' # every 3 hours | ||
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: | ||
# Consider '3.10' or 'v3.10.0': https://github.com/actions/setup-python/issues/160 | ||
python-version: '3.9' # Not sure why 3.9.7 here and 3.9 elsewhere. the .7 works on Mac, but not on Ubuntu | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Functions ----------------------------------------------------------------------------------------------------------- | ||
CREATE OR REPLACE FUNCTION array_sort (ANYARRAY) | ||
RETURNS ANYARRAY LANGUAGE SQL | ||
AS $$ | ||
SELECT ARRAY(SELECT unnest($1) ORDER BY 1) | ||
$$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.