<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks, James. I glanced at that, but somehow didn't realize those were endpoints I could hit. I'll give it a go!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Joshua<br>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> archivesspace_users_group-bounces@lyralists.lyrasis.org <archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of James Bullen
 <james@hudmol.com><br>
<b>Sent:</b> Tuesday, February 18, 2020 7:16 PM<br>
<b>To:</b> Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject:</b> Re: [Archivesspace_Users_Group] Method to Pause Indexer during Job Run?</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class=""><br class="">
</div>
Hi Joshua,
<div class=""><br class="">
</div>
<div class="">I haven’t used it, but I see these endpoints in indexer/app/main.rb</div>
<div class=""><br class="">
</div>
<div class=""><font class="" face="Courier New"><span class="" style="font-style:normal">  get "/" do<br class="">
    if IndexerCommon.paused?<br class="">
      "Indexers paused until #{IndexerCommon.class_variable_get(:@@paused_until)}"<br class="">
    else<br class="">
      "Running every #{AppConfig[:solr_indexing_frequency_seconds].to_i} seconds. "<br class="">
    end<br class="">
  end<br class="">
<br class="">
  # this pauses the indexer so that bulk update and migrations can happen<br class="">
  # without bogging down the server<br class="">
  put "/" do<br class="">
    duration = params[:duration].nil? ? 900 : params[:duration].to_i<br class="">
    IndexerCommon.pause duration<br class="">
    "#{IndexerCommon.class_variable_get(:@@paused_until)}"<br class="">
  end</span></font></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Seems to do what you want.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">James</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Feb 19, 2020, at 6:29 AM, Joshua D. Shaw <<a href="mailto:Joshua.D.Shaw@dartmouth.edu" class="">Joshua.D.Shaw@dartmouth.edu</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Hey all-</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
I writing a job that may take a *<b class="">long</b>* time (hours) to complete which will be updating a *<b class="">lot</b>* of AO records. I'm wondering if there's a way to pause the Indexer during a job so that I can let the Indexer do its thing<b class="">*after</b>*
 the job completes. I know I can toggle the AppConfig value for the indexer and do a stop/start for the app, but ideally I'd like to do the pause/resume of the Indexer while the job runs.</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
I could also set this up as a migration, but the updates include a bunch of tables (I'm adding an instance to AOs which meet certain criteria) and I'd prefer to use the API to do things to be safe.<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Any thoughts on pausing the Indexer during a job, or do I bite the bullet and do this as a migration?</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Thanks!</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Joshua<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div id="x_Signature" class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
___________________</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Joshua Shaw (he, him)<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Technology Coordinator</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Rauner Special Collections Library & Digital Library Technologies Group<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Dartmouth College<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
603.646.0405<br class="">
</div>
</div>
<span class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">!DSPAM:5e4c3b1e193891489818497!
 _______________________________________________</span><br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Archivesspace_Users_Group
 mailing list</span><br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Flyralists.lyrasis.org%2Fmailman%2Flistinfo%2Farchivesspace_users_group&data=02%7C01%7Cjoshua.d.shaw%40dartmouth.edu%7C16cec040dfaa4f44eaa908d7b4d10635%7C995b093648d640e5a31ebf689ec9446f%7C0%7C0%7C637176682159514123&sdata=XU3deEry67Xzb8G%2BTEhiTGcxg646DhE3VFmNjZjWNvw%3D&reserved=0" originalsrc="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" shash="Kf91iwLBWXVEnTvv55Zv+uPYQKzWy3VjeGgcdhBMT9vlWX156/vyvOuxtRRTLNGhbbMqDRCzPicHxxxotQKl31Qlb21AH26xVYEk4XXyQvdqMZkpW+ftR7KFg2oJ1g2Nv7rJJLi6NNdm9PT9R/CFBUtR7uhiXR24hh+KcZtqaj0=" class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a><br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">!DSPAM:5e4c3b1e193891489818497!</span></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>