Add timer for saved searches#7152
Conversation
The timer method wraps the makeLinksForAllSavedSearches in a no-param method returning void with the @schedule annotation. The timer is sheduled to run once a week on Sunday at 12:30 AM. If we decide a different schedule is better in general, we should adjust thiis in the code before release. In special cases the schedule can be modified using and ejb-jar.xml file of the form(for ex Tuesday 2:30 PM) : <?xml version="1.0" encoding="UTF-8"?> <ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee" version = "3.1" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"> <enterprise-beans> <session> <ejb-name>SavedSearchServiceBean</ejb-name> <ejb-class>edu.harvard.iq.dataverse.search.savedsearch.SavedSearchServiceBean</ejb-class> <session-type>Stateless</session-type> <timer> <schedule> <minute>30</minute> <hour>14</hour> <day-of-week>Tue</day-of-week> </schedule> <timeout-method> <method-name>makeLinksForAllSavedSearchesTimer</method-name> </timeout-method> </timer> </session> </enterprise-beans> </ejb-jar>
pdurbin
left a comment
There was a problem hiding this comment.
I love how small and elegant the code is but we'll want some documentation for how to change the time and date (and about this new timer in general).
Here's what I would suggest:
- Put your XML config file in doc/sphinx-guides/source/_static/admin
- Edit doc/sphinx-guides/source/admin/timers.rst and use "download" syntax you see in doc/sphinx-guides/source/admin/make-data-count.rst like this:
Download :download:`counter-processor-config.yaml <../_static/admin/counter-processor-config.yaml>`
…ss error prone than alpha text) -"0" instead of "Sun" added documentation in timers.rst, including how to reconfigure timer schedule (caveat reconfiguring should be a one-off, tracking ejb-jar.xml files opens a can of worms IMHO). Added a sample ejb-jar file
- made sample file downloadable - removed line from API Guide about cron job (not needed now) - linked pages about Saved Search to each other - typos, formatting
pdurbin
left a comment
There was a problem hiding this comment.
@rtreacy overall this is looking good but I have some documentation suggestion, which I put in this pull request: rtreacy/dataverse#1
When I heard that the timer is configurable, I didn't realize we'd be asking people to recompile Dataverse. Most of our users won't bother with this but I think it's good that we're heading off the question, "Is it possible to reschedule the timer?"
I'll assign this to you to check out the pull request above. You can take as much or as little of it as you want. This is what I was going for:
- made sample file downloadable
- removed line from API Guide about cron job (not needed now)
- linked pages about Saved Search to each other
- typos, formatting
|
Is it true that you have to rebuild, or can you just drop the ejb file into the dir after the war is unpacked? (and restart payara I assume). That would be something many installations could handle. |
saved search doc clean up #6910
|
@qqmyers I don't know but I think what we have here is sufficient for our needs. I expect most installations won't bother changing it. Here are some resources I looked at:
|
|
The precompiled Sunday 12:30am time works as expected. Did not test the configurable time, need to compile it. Dropping it in an already deployed app doesn't work. |
Thanks for testing this, @kcondon |
|
If putting in documentation about reconfiguring is going to cause people to reconfigure because we say it can be done, I think we should remove the documentation |
The timer method wraps the makeLinksForAllSavedSearches in a no-param method returning void with the @schedule annotation.
The timer is sheduled to run once a week on Sunday at 12:30 AM. If we decide a different schedule is better in general, we
should adjust thiis in the code before release. In special cases the schedule can be modified using and ejb-jar.xml file
of the form(for ex Tuesday 2:30 PM) :
SavedSearchServiceBean
edu.harvard.iq.dataverse.search.savedsearch.SavedSearchServiceBean
Stateless
30
14
Tue
makeLinksForAllSavedSearchesTimer
What this PR does / why we need it:
Which issue(s) this PR closes:
Closes #6910
Special notes for your reviewer:
Suggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: