mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-23 05:08:32 +00:00
Use a new INSTANCE_NAME variable for this, instead of SERVER_NAME
This commit is contained in:
parent
5230ad8ee7
commit
1b4821d2b9
@ -16,6 +16,7 @@ API_TOKEN = environ.get('API_TOKEN', default = 'af95596f327c9ecc007b60414fc84b61
|
||||
|
||||
NAME = "CR Connect Workflow"
|
||||
SERVER_NAME = environ.get('SERVER_NAME', default="localhost:5000")
|
||||
INSTANCE_NAME = environ.get('INSTANCE_NAME', default='development')
|
||||
DEFAULT_PORT = "5000"
|
||||
FLASK_PORT = environ.get('PORT0') or environ.get('FLASK_PORT', default=DEFAULT_PORT)
|
||||
FRONTEND = environ.get('FRONTEND', default="localhost:4200")
|
||||
|
@ -5,14 +5,14 @@ from crc.scripts.script import Script
|
||||
class GetInstance(Script):
|
||||
|
||||
def get_description(self):
|
||||
return """Get the name of the current instance, using the SERVER_NAME environment variable."""
|
||||
return """Get the name of the current instance, using the INSTANCE_NAME environment variable."""
|
||||
|
||||
def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs):
|
||||
return self.do_task(task, study_id, workflow_id, *args, **kwargs)
|
||||
|
||||
def do_task(self, task, study_id, workflow_id, *args, **kwargs):
|
||||
if 'SERVER_NAME' in app.config:
|
||||
return app.config['SERVER_NAME']
|
||||
if 'INSTANCE_NAME' in app.config:
|
||||
return app.config['INSTANCE_NAME']
|
||||
# TODO: Not sure what we should do here
|
||||
app.logger.info('no_server_name: SERVER_NAME not configured for this server.')
|
||||
app.logger.info('no_instance_name: INSTANCE_NAME not configured for this server.')
|
||||
return ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user