Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timer table set failed #650

Merged
merged 2 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/createSwooleTimerTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require_once __DIR__.'/../src/Tables/TableFactory.php';

if (($serverState['octaneConfig']['max_execution_time'] ?? 0) > 0) {
$timerTable = TableFactory::make(250);
$timerTable = TableFactory::make($serverState['octaneConfig']['max_timer_table_size'] ?? 250);

$timerTable->column('worker_pid', Table::TYPE_INT);
$timerTable->column('time', Table::TYPE_INT);
Expand Down
13 changes: 13 additions & 0 deletions config/octane.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,17 @@

'max_execution_time' => 30,

/*
|--------------------------------------------------------------------------
| Maximum Timer Table Size
|--------------------------------------------------------------------------
|
| When using Swoole and max_execution_time is configured,
| it needs to be set according to the actual situation.
| The maximum number of rows a Table can store is positively related
| to this configuration item, but not identical.
|
*/

'max_timer_table_size' => 250,
];