Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have the Clear Server Cache button clear the cdm_cache and achilles_cache tables #2980

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

amarsan
Copy link
Collaborator

@amarsan amarsan commented Nov 15, 2024

closes #2847

Companion PR is OHDSI/WebAPI#2406

I added an .editorconfig file so that this project can have its own style conventions. I noticed that there were mixed spaces/tabs and tab sizes within individual files. I recommend turning whitespace diffs off when reviewing this PR.

There was an existing Clear Server Cache button. I have it pointing now to the new webapi/cdmResults/clearCache endpoint. I fixed the code so that if the clearCache operation returns an error response we alert the user.

@chrisknoll
Copy link
Collaborator

The button doesn't seem to reset it's state after clicking:

image

Should it go back to the blue state after the call is complete, or is it intended to be red after?

@amarsan
Copy link
Collaborator Author

amarsan commented Nov 22, 2024

@chrisknoll I did not work on that button. I only worked on the "Clear Server Cache" button that is below the table.

@amarsan
Copy link
Collaborator Author

amarsan commented Nov 22, 2024

That "Refresh Cache" button calls that code that "warms" the cache. The warming is done in an async job.

@chrisknoll
Copy link
Collaborator

Ok, sorry. I misunderstood. It hought the individual buttons called the clear cache by source, and you made the bottom one do the same thing for each source.

Ok, can I ask that the buttons next to the source do the following:

  1. Call the delete cache results in the WebAPI db for the given source (sync operation)
  2. Call warm cache (the existing functionality).

I think we want to be able to isolate the clear cache of the individual sources...usually you have mutliple cdms set up and you only want to refresh the cache on one of them at a time.

@amarsan
Copy link
Collaborator Author

amarsan commented Nov 25, 2024

@chrisknoll Just to clarify...you'd like for the "Refresh Cache" buttons in the source table to both delete cache results and warm the cache. Did I understand that correctly?

@chrisknoll
Copy link
Collaborator

Correct! We'd like to clear the cache before warming it.

@amarsan
Copy link
Collaborator Author

amarsan commented Nov 25, 2024

Also, regarding the button color after the operation is performed...the button turns red if no cache warming occurred, either because warming is not enabled or the source daimon priority is not high enough. It turns blue if warming does happen.

@chrisknoll
Copy link
Collaborator

Makes sense: in my DEV env, I disabled all warming caches because I'm launching and relaunching all the time. so I turn that off, but I do want to be able to clear the cache, so making the button do it and then try to warm cache (but reject because it's disabled) is a good behavior.

@chrisknoll chrisknoll added this to the v2.15 milestone Nov 27, 2024
@chrisknoll chrisknoll merged commit 0f4594e into OHDSI:master Nov 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clear Server Cache goes to a dead endpoint
2 participants