OHDSI / Atlas

ATLAS is an open source software tool for researchers to conduct scientific analyses on standardized observational data
http://atlas-demo.ohdsi.org/
Apache License 2.0
273 stars 137 forks source link

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

Open amarsan opened 1 week ago

amarsan commented 1 week ago

closes https://github.com/OHDSI/Atlas/issues/2847

Companion PR is https://github.com/OHDSI/WebAPI/pull/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 commented 4 days ago

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 commented 4 days ago

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

amarsan commented 4 days ago

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

chrisknoll commented 2 days ago

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 commented 1 day ago

@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 commented 1 day ago

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

amarsan commented 1 day ago

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 commented 18 hours ago

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.