public void Run(object o) { while (true) { if (!_nodeInfo.HaveAcessRight) { break; } if (!PureCat.IsInitialized()) { Thread.Sleep(5000); continue; } PureCat.DoTransaction("System", "Status", () => { _nodeInfo.Refresh(); PureCat.LogHeartbeat("Heartbeat", AppEnv.IP, PureCatConstants.SUCCESS, XmlHelper.XmlSerialize(_nodeInfo, Encoding.UTF8)); PureCat.LogEvent("System", $"Cat.Version : {PureCat.Version}", PureCatConstants.SUCCESS, PureCat.Version); }); Thread.Sleep(60000); } }
static void Main(string[] args) { PureCat.Initialize(); while (true) { var a = DateTime.Now.Second; Console.WriteLine(DateTime.Now); var context = PureCat.DoTransaction("Do", nameof(DoTest), DoTest); var b = DateTime.Now.Second; PureCat.DoTransaction("Do", nameof(Add), () => Add(a, b, context)); } }