修复nodeid溢出问题

This commit is contained in:
redkale
2023-12-28 19:41:21 +08:00
parent 83dd4da4ec
commit 46d2629fca
6 changed files with 10 additions and 6 deletions

2
docs/cache-source.md Normal file
View File

@@ -0,0 +1,2 @@
# 缓存数据源
文档完善中……

View File

@@ -4,7 +4,7 @@
&emsp;&emsp;&emsp;&emsp; 2、返回类型必须是可json序列化的 <br> &emsp;&emsp;&emsp;&emsp; 2、返回类型必须是可json序列化的 <br>
&emsp;&emsp;&emsp;&emsp; 3、修饰必须是```protected```/```public``` <br> &emsp;&emsp;&emsp;&emsp; 3、修饰必须是```protected```/```public``` <br>
&emsp;&emsp;&emsp;&emsp; 4、修饰不能是```final```/```static``` <br> &emsp;&emsp;&emsp;&emsp; 4、修饰不能是```final```/```static``` <br>
&emsp;&emsp;本地缓存和远程缓存可同时设置,```expire```设置为0表示永不过期。 &emsp;&emsp;本地缓存和远程缓存可同时设置,```expire```设置为0表示永不过期, 支持异步方法(返回类型为```CompletableFuture```)
&emsp;&emsp;将结果进行本地缓存30秒且远程缓存60秒 &emsp;&emsp;将结果进行本地缓存30秒且远程缓存60秒
```java ```java

View File

@@ -30,21 +30,21 @@
<application nodeid="1000" port="6560" lib=""> <application nodeid="1000" port="6560" lib="">
<!-- <!--
【节点全局唯一】 @since 2.3.0 【节点全局唯一】
全局Serivce执行的线程池 Application.workExecutor, 没配置该节点将自动创建一个。 全局Serivce执行的线程池 Application.workExecutor, 没配置该节点将自动创建一个。
threads 线程数为0表示不启用workExecutor只用IO线程。默认: CPU核数, 核数=1的情况下默认值为2 threads 线程数为0表示不启用workExecutor只用IO线程。默认: CPU核数, 核数=1的情况下默认值为2
--> -->
<executor threads="4"/> <executor threads="4"/>
<!-- <!--
【节点全局唯一】 @since 2.8.0 【节点全局唯一】
全局Serivce的定时任务设置没配置该节点将自动创建一个。 全局Serivce的定时任务设置没配置该节点将自动创建一个。
enabled 是否开启缓存功能。默认: true enabled 是否开启缓存功能。默认: true
--> -->
<schedule enabled="true"/> <schedule enabled="true"/>
<!-- <!--
【节点全局唯一】 @since 2.8.0 【节点全局唯一】
全局Serivce的缓存设置没配置该节点将自动创建一个。 全局Serivce的缓存设置没配置该节点将自动创建一个。
enabled 是否开启缓存功能。默认: true enabled 是否开启缓存功能。默认: true
source: 远程CacheSource的资源名 source: 远程CacheSource的资源名

2
docs/data-source.md Normal file
View File

@@ -0,0 +1,2 @@
# DB数据源
文档完善中……

View File

@@ -272,8 +272,8 @@ public final class Application {
this.resourceFactory.register(RESNAME_APP_NAME, String.class, this.name); this.resourceFactory.register(RESNAME_APP_NAME, String.class, this.name);
this.resourceFactory.register(RESNAME_APP_NODEID, String.class, this.nodeid); this.resourceFactory.register(RESNAME_APP_NODEID, String.class, this.nodeid);
if (Utility.isNumeric(this.nodeid)) { if (Utility.isNumeric(this.nodeid)) { //兼容旧类型
this.resourceFactory.register(RESNAME_APP_NODEID, int.class, Integer.parseInt(this.nodeid)); this.resourceFactory.register(RESNAME_APP_NODEID, int.class, Math.abs(((Long) Long.parseLong(this.nodeid)).intValue()));
} }
this.resourceFactory.register(RESNAME_APP_TIME, long.class, this.startTime); this.resourceFactory.register(RESNAME_APP_TIME, long.class, this.startTime);