mirror of
https://github.com/snltty/linker.git
synced 2025-10-26 18:40:33 +08:00
计划任务
This commit is contained in:
@@ -71,7 +71,7 @@ namespace linker.messenger.plan
|
||||
{
|
||||
PlanGetInfo info = serializer.Deserialize<PlanGetInfo>(connection.ReceiveRequestWrap.Payload.Span);
|
||||
if (signCaching.TryGet(info.MachineId, out SignCacheInfo cacheTo) && signCaching.TryGet(connection.Id, out SignCacheInfo cacheFrom) && cacheFrom.GroupId == cacheTo.GroupId)
|
||||
{
|
||||
{
|
||||
uint requestid = connection.ReceiveRequestWrap.RequestId;
|
||||
await messengerSender.SendReply(new MessageRequestWrap
|
||||
{
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
{
|
||||
public enum PlanMessengerIds : ushort
|
||||
{
|
||||
Min = 3000,
|
||||
Min = 3200,
|
||||
|
||||
Add = 3001,
|
||||
AddForward = 3002,
|
||||
Add = 3201,
|
||||
AddForward = 3202,
|
||||
|
||||
Remove = 3003,
|
||||
RemoveForward = 3004,
|
||||
Remove = 3203,
|
||||
RemoveForward = 3204,
|
||||
|
||||
Get = 3005,
|
||||
GetForward = 3006,
|
||||
Get = 3205,
|
||||
GetForward = 3206,
|
||||
|
||||
Max = 3099
|
||||
Max = 3299
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace linker.messenger.sforward.client
|
||||
if (forwardInfo != null)
|
||||
{
|
||||
Start(forwardInfo, flag);
|
||||
OnChanged();
|
||||
}
|
||||
}
|
||||
public void Stop(long id, string flag = "")
|
||||
@@ -42,6 +43,7 @@ namespace linker.messenger.sforward.client
|
||||
if (forwardInfo != null)
|
||||
{
|
||||
Stop(forwardInfo, flag);
|
||||
OnChanged();
|
||||
}
|
||||
}
|
||||
private void Start(SForwardInfo forwardInfo, string flag = "")
|
||||
@@ -82,15 +84,12 @@ namespace linker.messenger.sforward.client
|
||||
{
|
||||
sForwardClientStore.Update(forwardInfo.Id, false, string.Empty);
|
||||
}
|
||||
|
||||
OnChanged();
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
sForwardClientStore.Update(forwardInfo.Id, false, ex.Message);
|
||||
LoggerHelper.Instance.Error(ex);
|
||||
OnChanged();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -109,7 +108,6 @@ namespace linker.messenger.sforward.client
|
||||
{
|
||||
OnClose(forwardInfo.Id, flag);
|
||||
sForwardClientStore.Update(forwardInfo.Id, false, string.Empty);
|
||||
OnChanged();
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -122,12 +120,14 @@ namespace linker.messenger.sforward.client
|
||||
public bool Add(SForwardInfo forwardInfo)
|
||||
{
|
||||
sForwardClientStore.Add(forwardInfo);
|
||||
OnChanged();
|
||||
return true;
|
||||
}
|
||||
public bool Remove(int id)
|
||||
{
|
||||
Stop(id);
|
||||
sForwardClientStore.Remove(id);
|
||||
OnChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ namespace linker.plugins.sforward.messenger
|
||||
await sender.SendOnly(new MessageRequestWrap
|
||||
{
|
||||
Connection = cacheTo.Connection,
|
||||
MessengerId = (ushort)SForwardMessengerIds.TestClientForward
|
||||
MessengerId = (ushort)SForwardMessengerIds.TestClient
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,6 @@ export default {
|
||||
if(regex.test(rule) == false){
|
||||
return;
|
||||
}
|
||||
console.log(rule.match(regex));
|
||||
const [,year,month,day,hour,minute,second] = rule.match(regex);
|
||||
if(minute == '*') state.ruleAt.type = 5;
|
||||
else if(hour == '*') state.ruleAt.type = 4;
|
||||
|
||||
@@ -36,12 +36,12 @@ export default {
|
||||
provide('plan',plan);
|
||||
const _getPlans = () => {
|
||||
clearTimeout(plan.value.timer);
|
||||
console.log(plan.value.machineid,props.category);
|
||||
getPlans(plan.value.machineid,props.category).then((res) => {
|
||||
plan.value.list = res.reduce((json,item,index)=>{
|
||||
json[`${item.Key}-${item.Handle}`] = item;
|
||||
return json;
|
||||
},{});
|
||||
|
||||
plan.value.timer = setTimeout(_getPlans,1000);
|
||||
}).catch(()=>{
|
||||
plan.value.timer = setTimeout(_getPlans,1000);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
v1.7.1
|
||||
2025-03-29 23:06:39
|
||||
2025-03-29 23:51:48
|
||||
1. 优化数据同步
|
||||
2. 优化linux的tun网卡网卡,读写分离,提高性能
|
||||
3. 优化windows网卡的禁用自动启用
|
||||
|
||||
Reference in New Issue
Block a user