Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Auto reindex with SIL admReindex() function

I would like to call the admReindex() function to reindex JIRA once per week on Sunday morning at 1 AM which during our maintenance window.  I have looked for a way to automate calling this SIL function and cannot locate a time based function in which to call admReindex().   Is there an approach someone from Kepler-rominfo  can recommend.

3 answers

1 accepted

2 votes
Answer accepted

Hi Craig,

In case you still need it, since JJUPIN 3.0.8 scheduler services have been implemented.
They are available only for JIRA versions greater that or equal to 6.2. smile

 

Hope this helps,
Alexandra 

I will have to upgrade our JJupin to try this approach. We are on Jira 6.3.9. So no problem. In practice the approach I mentioned above worked in test but DID NOT work in Prod. In fact, it corrupted my index. Thanks

You should ask for support when running into problems, It's a joy to work with Kepler team.

Hi there,

I don't know if that is the "proper" way to do it, but for sure one of the easiest way to do this is something like this:

Set up a SIL service with 1h interval and with following SIL sript:

string CurrentDayOfWeek = dayOfWeek(currentDate());
number CurrentHour = hour(currentDate());

logPrint("INFO", "Weekly reindex service initiated. Checking timestamp...");
if (CurrentHour == 1 && CurrentDayOfWeek == "Sun")
{
	logPrint("INFO", "Timestamp correct. Beginning reindex.");
	admReindex();
}
else
{
    logPrint("INFO", "Timestamp incorrect. Service aborted.");
}

 

I think the more bulletproof way would be to call one global service with a short timer like 5 minutes. This service could look into the database, check last and next execution times of the dependant services and execute the ones that meet the conditions. Never done it this way but this approach could get rid of few drawbacks of JIRA interval-timed services.

@Błażej Olszyca This seems a most reasonable approach. I will try it on our test instance and see how it goes. Thank you --Craig

@Błażej Olszyca Yes this does work well. Thanks

Hi Craig,

 

JJupin doesn't have a cron-like service yet, if your instance won't be restarted you can use a SIL Service with a high enough delay. You can also create a cron job yourself and, using curl, you can call the runScript REST method ( https://confluence.kepler-rominfo.com/display/SIL30/Common+REST+Service#CommonRESTService-runScript ). The script can be anything you like, including admReindex. 

 

HTH,

Silviu

@Silviu Burcea Hi, I will investigate this approach as well. Thanks --Craig

@Craig Leigh Alexandra's answer outperforms mine, it's the right way and her answer should be accepted too.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Learn how to request and manage app requests in the Marketplace

G’day everyone! Super exciting news coming from the Marketplace. We have now fully rolled out the ability for end-users to submit app requests to admins directly from within the product! No longer ...

43 views 1 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you