KDB 实例自动关闭
Auto shut down for KDB instance
我正在尝试在启动 24 小时后在 KDB 实例上设置自动关机。
我一直在研究 .z.exit
和 \t
但无法弄清楚。
在启动时您可以定义您的开始时间,然后设置一个计时器来检查当前时间是否晚于 24 小时然后退出。
startTime:.z.P;
.z.exit:{"Whatever you want to happen on exit"};
.z.ts:{if[1D<.z.P-startTime;exit 0]};
system"t 60000"; /set timer to whatever frequency
您需要设置定时功能.z.ts
(https://code.kx.com/q/ref/dotz/#zts-timer) which is triggered at each interval set by \t
to terminate the q process using exit
(https://code.kx.com/q/ref/exit/),例如
q) set timer to 24 hours (milliseconds)
q)\t 24*60*60*1000
q).z.ts:{exit 0}
我正在尝试在启动 24 小时后在 KDB 实例上设置自动关机。
我一直在研究 .z.exit
和 \t
但无法弄清楚。
在启动时您可以定义您的开始时间,然后设置一个计时器来检查当前时间是否晚于 24 小时然后退出。
startTime:.z.P;
.z.exit:{"Whatever you want to happen on exit"};
.z.ts:{if[1D<.z.P-startTime;exit 0]};
system"t 60000"; /set timer to whatever frequency
您需要设置定时功能.z.ts
(https://code.kx.com/q/ref/dotz/#zts-timer) which is triggered at each interval set by \t
to terminate the q process using exit
(https://code.kx.com/q/ref/exit/),例如
q) set timer to 24 hours (milliseconds)
q)\t 24*60*60*1000
q).z.ts:{exit 0}