Skip to content

Commit

Permalink
Scheduling watch paths to run immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
costrouc committed Aug 20, 2021
1 parent 9199fcb commit 2fa44de
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
11 changes: 7 additions & 4 deletions conda-store-server/conda_store_server/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@ def after_request_function(response):
app.register_blueprint(app_auth, url_prefix=self.url_prefix)

app.conda_store.ensure_namespace()
app.conda_store.ensure_directories()
app.conda_store.configuration.update_storage_metrics(
app.conda_store.db, app.conda_store.store_directory
)
app.conda_store.ensure_conda_channels()

# schedule tasks
app.conda_store.celery_app

from conda_store_server.worker import tasks
(tasks.task_watch_paths.si()).apply_async(countdown=10)
(tasks.task_update_storage_metrics.si()).apply_async(countdown=10)

app.run(debug=True, host=self.address, port=self.port)
2 changes: 1 addition & 1 deletion conda-store-server/conda_store_server/worker/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def task_update_storage_metrics():
conda_store.session_factory.remove()


@task(name="task_update_conda_channels")
@task(name="task_update_conda_channels", rate_limit="10/m")
def task_update_conda_channels():
conda_store = create_worker().conda_store

Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/cypress/integration/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
describe('First Test', () => {
it('Check conda-store home page', () => {
// display home page without login
cy.visit('/conda-store/');

// visit login page
cy.visit('/conda-store/login/')

// click on sign in with jupyterhub
// login through jupyterhub oauth server
cy.get('#login > a')
.should('contain', 'Sign in with JupyterHub')
.click();

// fill in username and password and submit
cy.get('#username_input')
.type('conda-store-test');

Expand Down

0 comments on commit 2fa44de

Please sign in to comment.