Example #1
0
        private static void DoJob()
        {
            const int step  = 10000;
            var       start = 0;
            var       count = DalTask.GetWXBindUserCount();

            while (start < count)
            {
                var sw = new Stopwatch();
                sw.Start();
                var info = DalTask.GetWXBindUserList(start, step);
                start += step;
                if (info.Any())
                {
                    foreach (var item in info)
                    {
                        TuhuNotification.SendNotification("notification.TaskActionQueue", new Dictionary <string, string>
                        {
                            ["UserId"]     = item.ToString("D"),
                            ["ActionName"] = "4BindWX"
                        });
                        Thread.Sleep(100);
                    }
                }
                sw.Stop();
                Logger.Info($"会员任务-->绑定微信异常数据补偿Job-->第{start / step + 1}批,用时{sw.ElapsedMilliseconds}毫秒,共{count / step + 1}批");
            }
        }