You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.5 KiB

Graceful Queues: Issue Indexing and Tasks (#9363) * Queue: Add generic graceful queues with settings * Queue & Setting: Add worker pool implementation * Queue: Add worker settings * Queue: Make resizing worker pools * Queue: Add name variable to queues * Queue: Add monitoring * Queue: Improve logging * Issues: Gracefulise the issues indexer Remove the old now unused specific queues * Task: Move to generic queue and gracefulise * Issues: Standardise the issues indexer queue settings * Fix test * Queue: Allow Redis to connect to unix * Prevent deadlock during early shutdown of issue indexer * Add MaxWorker settings to queues * Merge branch 'master' into graceful-queues * Update modules/indexer/issues/indexer.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Update modules/indexer/issues/indexer.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Update modules/queue/queue_channel.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Update modules/queue/queue_disk.go * Update modules/queue/queue_disk_channel.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Rename queue.Description to queue.ManagedQueue as per @guillep2k * Cancel pool workers when removed * Remove dependency on queue from setting * Update modules/queue/queue_redis.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * As per @guillep2k add mutex locks on shutdown/terminate * move unlocking out of setInternal * Add warning if number of workers < 0 * Small changes as per @guillep2k * No redis host specified not found * Clean up documentation for queues * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md * Update modules/indexer/issues/indexer_test.go * Ensure that persistable channel queue is added to manager * Rename QUEUE_NAME REDIS_QUEUE_NAME * Revert "Rename QUEUE_NAME REDIS_QUEUE_NAME" This reverts commit 1f83b4fc9b9dabda186257b38c265fe7012f90df. Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years ago
  1. {{template "base/head" .}}
  2. <div class="admin monitor">
  3. {{template "admin/navbar" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <h4 class="ui top attached header">
  7. {{.i18n.Tr "admin.monitor.cron"}}
  8. </h4>
  9. <div class="ui attached table segment">
  10. <form method="post" action="{{AppSubUrl}}/admin">
  11. <input type="hidden" name="from" value="monitor"/>
  12. {{.CsrfTokenHtml}}
  13. <table class="ui very basic striped table">
  14. <thead>
  15. <tr>
  16. <th></th>
  17. <th>{{.i18n.Tr "admin.monitor.name"}}</th>
  18. <th>{{.i18n.Tr "admin.monitor.schedule"}}</th>
  19. <th>{{.i18n.Tr "admin.monitor.next"}}</th>
  20. <th>{{.i18n.Tr "admin.monitor.previous"}}</th>
  21. <th>{{.i18n.Tr "admin.monitor.execute_times"}}</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. {{range .Entries}}
  26. <tr>
  27. <td><button type="submit" class="ui green button" name="op" value="{{.Name}}" title="{{$.i18n.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td>
  28. <td>{{$.i18n.Tr (printf "admin.dashboard.%s" .Name)}}</td>
  29. <td>{{.Spec}}</td>
  30. <td>{{DateFmtLong .Next}}</td>
  31. <td>{{if gt .Prev.Year 1 }}{{DateFmtLong .Prev}}{{else}}N/A{{end}}</td>
  32. <td>{{.ExecTimes}}</td>
  33. </tr>
  34. {{end}}
  35. </tbody>
  36. </table>
  37. </form>
  38. </div>
  39. <h4 class="ui top attached header">
  40. {{.i18n.Tr "admin.monitor.queues"}}
  41. </h4>
  42. <div class="ui attached table segment">
  43. <table class="ui very basic striped table">
  44. <thead>
  45. <tr>
  46. <th>{{.i18n.Tr "admin.monitor.queue.name"}}</th>
  47. <th>{{.i18n.Tr "admin.monitor.queue.type"}}</th>
  48. <th>{{.i18n.Tr "admin.monitor.queue.exemplar"}}</th>
  49. <th>{{.i18n.Tr "admin.monitor.queue.numberworkers"}}</th>
  50. <th></th>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. {{range .Queues}}
  55. <tr>
  56. <td>{{.Name}}</td>
  57. <td>{{.Type}}</td>
  58. <td>{{.ExemplarType}}</td>
  59. <td>{{$sum := .NumberOfWorkers}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
  60. <td><a href="{{$.Link}}/queue/{{.QID}}" class="button">{{if lt $sum 0}}{{$.i18n.Tr "admin.monitor.queue.review"}}{{else}}{{$.i18n.Tr "admin.monitor.queue.review_add"}}{{end}}</a>
  61. </tr>
  62. {{end}}
  63. </tbody>
  64. </table>
  65. </div>
  66. <h4 class="ui top attached header">
  67. {{.i18n.Tr "admin.monitor.process"}}
  68. </h4>
  69. <div class="ui attached table segment">
  70. <table class="ui very basic striped table">
  71. <thead>
  72. <tr>
  73. <th>Pid</th>
  74. <th>{{.i18n.Tr "admin.monitor.desc"}}</th>
  75. <th>{{.i18n.Tr "admin.monitor.start"}}</th>
  76. <th>{{.i18n.Tr "admin.monitor.execute_time"}}</th>
  77. <th></th>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. {{range .Processes}}
  82. <tr>
  83. <td>{{.PID}}</td>
  84. <td>{{.Description}}</td>
  85. <td>{{DateFmtLong .Start}}</td>
  86. <td>{{TimeSince .Start $.Lang}}</td>
  87. <td><a class="delete-button" href="" data-url="{{$.Link}}/cancel/{{.PID}}" data-id="{{.PID}}" data-name="{{.Description}}"><i class="close icon text red"></i></a></td>
  88. </tr>
  89. {{end}}
  90. </tbody>
  91. </table>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="ui small basic delete modal">
  96. <div class="ui icon header">
  97. <i class="close icon"></i>
  98. {{.i18n.Tr "admin.monitor.process.cancel"}}
  99. </div>
  100. <div class="content">
  101. <p>{{$.i18n.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p>
  102. <p>{{$.i18n.Tr "admin.monitor.process.cancel_desc"}}</p>
  103. </div>
  104. {{template "base/delete_modal_actions" .}}
  105. </div>
  106. {{template "base/footer" .}}