Skip to content

Commit

Permalink
Merge pull request #19 from unfoldingWord-dev/develop
Browse files Browse the repository at this point in the history
Just keep up-to-date with packages
  • Loading branch information
RobH123 committed Sep 5, 2019
2 parents cad2988 + ee577cc commit 604eafb
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ celerybeat-schedule
# virtualenv
.venv
venv/
myVenv/
ENV/

# Spyder project settings
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ clean_doc:

dependencies:
# It is recommended that a Python3 virtual environment be set-up before this point
# python3 -m venv venv
# source venv/bin/activate
# python3 -m venv myVenv
# source myVenv/bin/activate
pip3 install --upgrade pip
pip3 install --requirement tXenqueue/requirements.txt

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Requires:
Python 3.6 (or later)
To setup:
python3 -m venv venv
source venv/bin/activate
python3 -m venv myVenv
source vemyVenvnv/bin/activate
make dependencies
Set environment variables:
Expand Down
1 change: 1 addition & 0 deletions tXenqueue/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests/
scripts/
venv/
myVenv/

*.bak

Expand Down
2 changes: 1 addition & 1 deletion tXenqueue/check_posted_tx_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def check_posted_tx_payload(request, logger):
logger.error(f"Invalid user token '{payload_json['user_token']}' in tX payload")
return False, {'error': f"Invalid user token '{payload_json['user_token']}'"}
user = get_gogs_user(payload_json['user_token'])
logger.info(f"Found Gogs user: {user}")
logger.info(f"Found Gitea user: {user}")
if not user:
logger.error(f"Unknown user token '{payload_json['user_token']}' in tX payload")
return False, {'error': f"Unknown user token '{payload_json['user_token']}'"}
Expand Down
2 changes: 1 addition & 1 deletion tXenqueue/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Flask==1.1.1
rq==1.1.0
gunicorn==19.9.0
statsd==3.3.0
watchtower==0.6.0
watchtower==0.7.3
gogs_client==1.0.6
7 changes: 4 additions & 3 deletions tXenqueue/tx_enqueue_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
OUR_NAME = 'tX_webhook' # Becomes the (perhaps prefixed) queue name (and graphite name)
# -- MUST match setup.py in tx-job-handler
#CALLBACK_SUFFIX = '_callback'
DEV_PREFIX = 'dev-'

# NOTE: The following strings if not empty, MUST have a trailing slash but NOT a leading one.
WEBHOOK_URL_SEGMENT = '' # Leaving this blank will cause the service to run at '/'
Expand Down Expand Up @@ -75,14 +76,14 @@

# Setup queue variables
QUEUE_NAME_SUFFIX = '' # Used to switch to a different queue, e.g., '_1'
if prefix not in ('', 'dev-'):
logger.critical(f"Unexpected prefix: '{prefix}' -- expected '' or 'dev-'")
if prefix not in ('', DEV_PREFIX):
logger.critical(f"Unexpected prefix: '{prefix}' -- expected '' or '{DEV_PREFIX}'")
if prefix:
our_adjusted_name = prefix + OUR_NAME + QUEUE_NAME_SUFFIX # Will become our main queue name
our_other_adjusted_name = OUR_NAME + QUEUE_NAME_SUFFIX # The other queue name
else:
our_adjusted_name = OUR_NAME + QUEUE_NAME_SUFFIX # Will become our main queue name
our_other_adjusted_name = 'dev-'+OUR_NAME + QUEUE_NAME_SUFFIX # The other queue name
our_other_adjusted_name = DEV_PREFIX + OUR_NAME + QUEUE_NAME_SUFFIX # The other queue name
# NOTE: The prefixed version must also listen at a different port (specified in gunicorn run command)
#our_callback_name = our_adjusted_name + CALLBACK_SUFFIX
#our_other_adjusted_callback_name = our_other_adjusted_name + CALLBACK_SUFFIX
Expand Down

0 comments on commit 604eafb

Please sign in to comment.