mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-04 07:15:36 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21f310852a | ||
|
|
6173cf2e37 | ||
|
|
4791099a78 | ||
|
|
9d1952f5f8 | ||
|
|
6543574695 | ||
|
|
5b1c771a2d |
@@ -50,6 +50,8 @@ $config['runtime'] = [
|
||||
],
|
||||
'namespace' => [],
|
||||
],
|
||||
'inside_table_size' => 65536 // 内部表字符串最大长度(需要2的倍数)
|
||||
// 正常不要低于65536,如果群数量过多可能出现会size不够。若swoole日志出现WARNING TableRow::set_value(): [key=wait_api,field=value]string value is too long可以将该值往大设置。
|
||||
];
|
||||
|
||||
/* 轻量字符串缓存,默认开启 */
|
||||
|
||||
@@ -30,7 +30,7 @@ class ConsoleApplication extends Application
|
||||
{
|
||||
public const VERSION_ID = 480;
|
||||
|
||||
public const VERSION = '2.8.6';
|
||||
public const VERSION = '2.8.8';
|
||||
|
||||
private static $obj;
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class LightCache
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
$result = self::$kv_table->set($k, [
|
||||
$result = self::$kv_table->set((string)$k, [
|
||||
'value' => $value,
|
||||
'expire' => $v['expire'],
|
||||
'data_type' => $data_type,
|
||||
@@ -188,7 +188,10 @@ class LightCache
|
||||
$data_type = '';
|
||||
} elseif (is_int($value)) {
|
||||
$data_type = 'int';
|
||||
} else {
|
||||
} elseif (is_bool($value)) {
|
||||
$data_type = 'bool';
|
||||
$value = json_encode($value);
|
||||
} else {
|
||||
throw new LightCacheException('E00048', 'Only can set string, array and int');
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -17,7 +17,8 @@ class LightCacheInside
|
||||
public static function init(): bool
|
||||
{
|
||||
try {
|
||||
self::createTable('wait_api', 3, 65536);
|
||||
$size = ZMConfig::get('global', 'runtime')['inside_table_size'] ?? 65536;
|
||||
self::createTable('wait_api', 3, $size);
|
||||
self::createTable('connect', 3, 64); // 用于存单机器人模式下的机器人fd的
|
||||
self::createTable('static_route', 64, 256); // 用于存储
|
||||
self::createTable('light_array', 8, 512, 0.6);
|
||||
|
||||
Reference in New Issue
Block a user