public void RegisterSendMethod() { var cron = ConfigurationManagerExtension.AppSettings["core.notify.cron"] ?? "0 0 5 ? * *"; // 5am every day if (ConfigurationManagerExtension.AppSettings["core.notify.tariff"] != "false") { if (TenantExtra.Enterprise) { client.RegisterSendMethod(SendEnterpriseTariffLetters, cron); } else if (TenantExtra.Opensource) { client.RegisterSendMethod(SendOpensourceTariffLetters, cron); } else if (TenantExtra.Saas) { if (CoreContext.Configuration.Personal) { client.RegisterSendMethod(SendLettersPersonal, cron); } else { client.RegisterSendMethod(SendSaasTariffLetters, cron); } } } if (!CoreContext.Configuration.Personal) { client.RegisterSendMethod(SendMsgWhatsNew, "0 0 * ? * *"); // every hour } }
public static void RegisterSendMethod() { if (!_isRegistered) { lock (_syncName) { if (!_isRegistered) { _notifyClient.RegisterSendMethod(NotifyAbouFutureEvent, "0 * * ? * *"); _isRegistered = true; } } } }
public static void RegisterSendMethod() { if (!_isRegistered) { lock (_syncName) { if (!_isRegistered) { var now = DateTime.UtcNow; _notifyClient.RegisterSendMethod(NotifyAbouFutureEvent, TimeSpan.FromMinutes(1), new DateTime(now.Year, now.Month, now.Day, now.Hour, 0, 0)); _isRegistered = true; } } } }
public void RegisterSendMethod() { var now = DateTime.UtcNow; client.RegisterSendMethod(SendMsgWhatsNew, TimeSpan.FromHours(1), new DateTime(now.Year, now.Month, now.Day, now.Hour, 0, 0)); }