This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8592
in repository https://gitbox.apache.org/repos/asf/allura.git

commit a3d87741fc1365bd162e2c0740bb443a8898b7c2
Author: Dave Brondsema <[email protected]>
AuthorDate: Mon Dec 8 11:46:16 2025 -0500

    [#8592] reindex tasks run at lower priority
---
 Allura/allura/command/show_models.py | 4 +++-
 Allura/allura/tests/test_commands.py | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/command/show_models.py 
b/Allura/allura/command/show_models.py
index 54555fc32..70695d98a 100644
--- a/Allura/allura/command/show_models.py
+++ b/Allura/allura/command/show_models.py
@@ -78,7 +78,8 @@ class ReindexCommand(base.Command):
                            'Note: this is often better, since tasks have 
"request" objects '
                            'which are needed for some markdown macros to run 
properly')
     parser.add_option('--solr-hosts', dest='solr_hosts',
-                      help='Override the solr host(s) to post to.  
Comma-separated list of solr server URLs')
+                      help='Override the solr host(s) to post to.  
Comma-separated list of solr server URLs. '
+                           'Passed through to tasks if --tasks is used.')
     parser.add_option('--solr-creds', dest='solr_creds',
                       help='Creds for the solr host(s).  Comma-separated list 
of user:pwd strings')
     parser.add_option(
@@ -181,6 +182,7 @@ def _post_add_artifacts(self, chunk):
                 add_artifacts.post(chunk,
                                    update_solr=self.options.solr,
                                    update_refs=self.options.refs,
+                                   __task_priority=5,  # lower than default 10
                                    **self.add_artifact_kwargs)
         except InvalidDocument as e:
             # there are many types of InvalidDocument, only recurse if its
diff --git a/Allura/allura/tests/test_commands.py 
b/Allura/allura/tests/test_commands.py
index 112557e42..104c5c997 100644
--- a/Allura/allura/tests/test_commands.py
+++ b/Allura/allura/tests/test_commands.py
@@ -555,7 +555,7 @@ def on_post(chunk, **kw):
         cmd = show_models.ReindexCommand('reindex')
         cmd.options, args = cmd.parser.parse_args([])
         cmd._post_add_artifacts(list(range(5)))
-        kw = {'update_solr': cmd.options.solr, 'update_refs': cmd.options.refs}
+        kw = {'update_solr': cmd.options.solr, 'update_refs': 
cmd.options.refs, '__task_priority': 5}
         expected = [
             call([0, 1, 2, 3, 4], **kw),
             call([0, 1], **kw),

Reply via email to