mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 07:52:44 +00:00
refactor: share extension deferred and runtime helpers
This commit is contained in:
@@ -8,6 +8,11 @@ type PassiveChannelStatusSnapshot = {
|
||||
lastProbeAt?: number | null;
|
||||
};
|
||||
|
||||
type TrafficStatusSnapshot = {
|
||||
lastInboundAt?: number | null;
|
||||
lastOutboundAt?: number | null;
|
||||
};
|
||||
|
||||
export function buildPassiveChannelStatusSummary<TExtra extends object>(
|
||||
snapshot: PassiveChannelStatusSnapshot,
|
||||
extra?: TExtra,
|
||||
@@ -32,3 +37,12 @@ export function buildPassiveProbedChannelStatusSummary<TExtra extends object>(
|
||||
lastProbeAt: snapshot.lastProbeAt ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
export function buildTrafficStatusSummary<TSnapshot extends TrafficStatusSnapshot>(
|
||||
snapshot?: TSnapshot | null,
|
||||
) {
|
||||
return {
|
||||
lastInboundAt: snapshot?.lastInboundAt ?? null,
|
||||
lastOutboundAt: snapshot?.lastOutboundAt ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user