Skip to content

Commit

Permalink
Merge pull request #91 from golnazads/master
Browse files Browse the repository at this point in the history
added DATA EMAC
  • Loading branch information
golnazads committed Jun 9, 2023
2 parents de3e96c + f680a46 commit f0a241a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python_actions.yml
Expand Up @@ -43,8 +43,8 @@ jobs:
# psql -c 'create database test;'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# pip install --upgrade setuptools for now becuase of an issue with ConcurrentLogHandler
python -m pip install --upgrade wheel pip
pip install -U -r requirements.txt
pip install -U -r dev-requirements.txt
Expand Down
4 changes: 4 additions & 0 deletions config.py
Expand Up @@ -133,6 +133,10 @@
"name": "European Centre for Medium-Range Weather Forecasts",
"url": "https://www.ecmwf.int/",
},
"EMAC": {
"name": "Exoplanet Modeling and Analysis Center",
"url": "https://emac.gsfc.nasa.gov",
},
"EMFISIS": {
"name": "An instrument suite on the Van Allen Probes",
"url": "https://emfisis.physics.uiowa.edu/",
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
@@ -1,4 +1,7 @@
git+https://github.com/adsabs/ADSMicroserviceUtils.git@v1.2.0
git+https://github.com/adsabs/ADSPipelineMsg.git@v1.3.2
alembic==0.8.9
itsdangerous==2.0.1
jinja2==3.0.3
psycopg2-binary==2.8.3
werkzeug==2.0.2
2 changes: 2 additions & 0 deletions resolversrv/utils.py
Expand Up @@ -184,9 +184,11 @@ def add_records_new(documents):
try:
with current_app.session_scope() as session:
session.execute(on_conflict_stmt)
current_app.logger.info('updated db with new data successfully')
return True, 'updated db with new data successfully'
except SQLAlchemyError as e:
session.rollback()
current_app.logger.error('SQLAlchemy: ' + str(e))
return False, 'SQLAlchemy: ' + str(e)
return False, 'unable to add records to the database'

Expand Down
2 changes: 1 addition & 1 deletion resolversrv/views.py
Expand Up @@ -879,7 +879,7 @@ def process_request_new(self, payload):
return JsonResponse({'error': 'no bibcode received'}, 400)

if len(bibcodes) > current_app.config['RESOLVER_MAX_RECORDS_DEL']:
return JsonResponse({'error': 'too many records to delete to db at one time, received %s records while the limit is %s' % (len(bibcodes), current_app.config['RESOLVER_MAX_RECORDS_DEL'])}, 400)
return JsonResponse({'error': 'too many records to delete from db at one time, received %s records while the limit is %s' % (len(bibcodes), current_app.config['RESOLVER_MAX_RECORDS_DEL'])}, 400)

current_app.logger.info('received request to delete from db %d bibcodes' % (len(bibcodes)))

Expand Down

0 comments on commit f0a241a

Please sign in to comment.