مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
feat(worker): allow number of threads to be configured
This allows for more threads to be run. Care needs to be taken to ensure that database connection pool size is appropriate for this.
هذا الالتزام موجود في:
@@ -45,7 +45,9 @@ module Worker
|
||||
].freeze
|
||||
|
||||
# @param [Integer] thread_count The number of worker threads to run in this process
|
||||
def initialize(thread_count: 2, work_sleep_time: 5, task_sleep_time: 60)
|
||||
def initialize(thread_count: Postal::Config.worker.threads,
|
||||
work_sleep_time: 5,
|
||||
task_sleep_time: 60)
|
||||
@thread_count = thread_count
|
||||
@exit_pipe_read, @exit_pipe_write = IO.pipe
|
||||
@work_sleep_time = work_sleep_time
|
||||
|
||||
@@ -25,6 +25,7 @@ This document contains all the environment variables which are available for thi
|
||||
| `WEB_SERVER_MAX_THREADS` | Integer | The maximum number of threads which can be used by the web server | 5 |
|
||||
| `WORKER_DEFAULT_HEALTH_SERVER_PORT` | Integer | The default port for the worker health server to listen on | 9090 |
|
||||
| `WORKER_DEFAULT_HEALTH_SERVER_BIND_ADDRESS` | String | The default bind address for the worker health server to listen on | 127.0.0.1 |
|
||||
| `WORKER_THREADS` | Integer | The number of threads to execute within each worker | 2 |
|
||||
| `MAIN_DB_HOST` | String | Hostname for the main MariaDB server | localhost |
|
||||
| `MAIN_DB_PORT` | Integer | The MariaDB port to connect to | 3306 |
|
||||
| `MAIN_DB_USERNAME` | String | The MariaDB username | postal |
|
||||
|
||||
@@ -47,6 +47,8 @@ worker:
|
||||
default_health_server_port: 9090
|
||||
# The default bind address for the worker health server to listen on
|
||||
default_health_server_bind_address: 127.0.0.1
|
||||
# The number of threads to execute within each worker
|
||||
threads: 2
|
||||
|
||||
main_db:
|
||||
# Hostname for the main MariaDB server
|
||||
|
||||
@@ -130,6 +130,11 @@ module Postal
|
||||
description "The default bind address for the worker health server to listen on"
|
||||
default "127.0.0.1"
|
||||
end
|
||||
|
||||
integer :threads do
|
||||
description "The number of threads to execute within each worker"
|
||||
default 2
|
||||
end
|
||||
end
|
||||
|
||||
group :main_db do
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم