Skip to content

Commit

Permalink
build(requirements): Upgrade vulnerable dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Nov 25, 2021
1 parent ceefbdd commit a35c514
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/tasks/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Instead, load a file:
psql pelican_backend -c "\copy exchange_rates (valid_on, rates) from 'pelican/static/exchange_rates_dump.csv' delimiter ',' csv header;"
.. note::

The :ref:`extract-kingfisher-process` worker fetches missing exchange rates when it receives a message. To avoid duplication across processes and/or threads, you can run the :ref:`manage-update-exchange-rates` command periodically.

Dump exchange rates
-------------------

Expand Down
11 changes: 11 additions & 0 deletions docs/tasks/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,14 @@ Delete a dataset.
--include-filtered Delete any filtered datasets based on this dataset.

The dataset must be in either the ``CHECKED`` or ``DELETED`` phase and the ``OK`` state.

.. _manage-update-exchange-rates:

update-exchange-rates
---------------------

.. code-block:: bash
./manage.py update-exchange-rates
Update the exchange rates.
10 changes: 10 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import click

from tools import exchange_rates_db, settings
from tools.bootstrap import bootstrap
from tools.db import commit, get_cursor
from tools.logging_helper import get_logger
Expand All @@ -13,6 +14,15 @@ def cli():
pass


@cli.command()
def update_exchange_rates():
"""
Update the exchange rates.
"""
if settings.FIXER_IO_API_KEY:
exchange_rates_db.update_from_fixer_io()


@cli.command()
@click.argument("name")
@click.argument("collection_id")
Expand Down
3 changes: 0 additions & 3 deletions workers/extract/kingfisher_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ def start():
"""
init_worker()

if settings.FIXER_IO_API_KEY:
exchange_rates_db.update_from_fixer_io()

create_client().consume(callback, consume_routing_key)


Expand Down

0 comments on commit a35c514

Please sign in to comment.