diff --git a/DysonNetwork.Pass/Account/Presences/SteamPresenceService.cs b/DysonNetwork.Pass/Account/Presences/SteamPresenceService.cs index 23fe6ad..9314ed2 100644 --- a/DysonNetwork.Pass/Account/Presences/SteamPresenceService.cs +++ b/DysonNetwork.Pass/Account/Presences/SteamPresenceService.cs @@ -106,12 +106,12 @@ public class SteamPresenceService( "steam", account.Id, UpdateActivityWithPresenceData, - 5 + 10 ); // If update failed (no existing activity), create a new one if (updatedActivity == null) - await accountEventService.SetActivity(presenceActivity, 5); + await accountEventService.SetActivity(presenceActivity, 10); // Local function to avoid capturing external variables in lambda void UpdateActivityWithPresenceData(SnPresenceActivity activity) @@ -167,12 +167,12 @@ public class SteamPresenceService( "steam", account.Id, UpdateActivityWithPresenceData, - 5 + 10 ); // If update failed (no existing activity), create a new one if (updatedActivity == null) - await accountEventService.SetActivity(presenceActivity, 5); + await accountEventService.SetActivity(presenceActivity, 10); // Local function to avoid capturing external variables in lambda void UpdateActivityWithPresenceData(SnPresenceActivity activity) diff --git a/DysonNetwork.Pass/Auth/OpenId/SteamOidcService.cs b/DysonNetwork.Pass/Auth/OpenId/SteamOidcService.cs index 2cbe3f0..ff37032 100644 --- a/DysonNetwork.Pass/Auth/OpenId/SteamOidcService.cs +++ b/DysonNetwork.Pass/Auth/OpenId/SteamOidcService.cs @@ -1,5 +1,4 @@ using DysonNetwork.Shared.Cache; -using System.Web; namespace DysonNetwork.Pass.Auth.OpenId; diff --git a/DysonNetwork.Pass/Startup/ScheduledJobsConfiguration.cs b/DysonNetwork.Pass/Startup/ScheduledJobsConfiguration.cs index aa1d885..815a71c 100644 --- a/DysonNetwork.Pass/Startup/ScheduledJobsConfiguration.cs +++ b/DysonNetwork.Pass/Startup/ScheduledJobsConfiguration.cs @@ -13,82 +13,73 @@ public static class ScheduledJobsConfiguration { services.AddQuartz(q => { - var appDatabaseRecyclingJob = new JobKey("AppDatabaseRecycling"); - q.AddJob(opts => opts.WithIdentity(appDatabaseRecyclingJob)); + q.AddJob(opts => opts.WithIdentity("AppDatabaseRecycling")); q.AddTrigger(opts => opts - .ForJob(appDatabaseRecyclingJob) + .ForJob("AppDatabaseRecycling") .WithIdentity("AppDatabaseRecyclingTrigger") .WithCronSchedule("0 0 0 * * ?")); - var actionLogFlushJob = new JobKey("ActionLogFlush"); - q.AddJob(opts => opts.WithIdentity(actionLogFlushJob)); + q.AddJob(opts => opts.WithIdentity("ActionLogFlush")); q.AddTrigger(opts => opts - .ForJob(actionLogFlushJob) + .ForJob("ActionLogFlush") .WithIdentity("ActionLogFlushTrigger") .WithSimpleSchedule(o => o .WithIntervalInMinutes(5) .RepeatForever()) ); - var lastActiveFlushJob = new JobKey("LastActiveFlush"); - q.AddJob(opts => opts.WithIdentity(lastActiveFlushJob)); + q.AddJob(opts => opts.WithIdentity("LastActiveFlush")); q.AddTrigger(opts => opts - .ForJob(lastActiveFlushJob) + .ForJob("LastActiveFlush") .WithIdentity("LastActiveFlushTrigger") .WithSimpleSchedule(o => o .WithIntervalInMinutes(5) .RepeatForever()) ); - var subscriptionRenewalJob = new JobKey("SubscriptionRenewal"); - q.AddJob(opts => opts.WithIdentity(subscriptionRenewalJob)); + q.AddJob(opts => opts.WithIdentity("SubscriptionRenewal")); q.AddTrigger(opts => opts - .ForJob(subscriptionRenewalJob) + .ForJob("SubscriptionRenewal") .WithIdentity("SubscriptionRenewalTrigger") .WithSimpleSchedule(o => o .WithIntervalInMinutes(30) .RepeatForever()) ); - var giftCleanupJob = new JobKey("GiftCleanup"); - q.AddJob(opts => opts.WithIdentity(giftCleanupJob)); + q.AddJob(opts => opts.WithIdentity("GiftCleanup")); q.AddTrigger(opts => opts - .ForJob(giftCleanupJob) + .ForJob("GiftCleanup") .WithIdentity("GiftCleanupTrigger") .WithSimpleSchedule(o => o .WithIntervalInHours(1) .RepeatForever()) ); - var fundExpirationJob = new JobKey("FundExpiration"); - q.AddJob(opts => opts.WithIdentity(fundExpirationJob)); + q.AddJob(opts => opts.WithIdentity("FundExpiration")); q.AddTrigger(opts => opts - .ForJob(fundExpirationJob) + .ForJob("FundExpiration") .WithIdentity("FundExpirationTrigger") .WithSimpleSchedule(o => o .WithIntervalInHours(1) .RepeatForever()) ); - var lotteryDrawJob = new JobKey("LotteryDraw"); - q.AddJob(opts => opts.WithIdentity(lotteryDrawJob)); + q.AddJob(opts => opts.WithIdentity("LotteryDraw")); q.AddTrigger(opts => opts - .ForJob(lotteryDrawJob) + .ForJob("LotteryDraw") .WithIdentity("LotteryDrawTrigger") .WithCronSchedule("0 0 0 * * ?")); - var socialCreditValidationJob = new JobKey("SocialCreditValidation"); - q.AddJob(opts => opts.WithIdentity(socialCreditValidationJob)); + q.AddJob(opts => opts.WithIdentity("SocialCreditValidation")); q.AddTrigger(opts => opts - .ForJob(socialCreditValidationJob) + .ForJob("SocialCreditValidation") .WithIdentity("SocialCreditValidationTrigger") .WithCronSchedule("0 0 0 * * ?")); // Presence update jobs for different user stages - var activePresenceUpdateJob = new JobKey("ActivePresenceUpdate"); - q.AddJob(opts => opts.WithIdentity(activePresenceUpdateJob)); + q.AddJob(opts => opts.WithIdentity("ActivePresenceUpdate")); q.AddTrigger(opts => opts - .ForJob(activePresenceUpdateJob) + .ForJob("ActivePresenceUpdate") .WithIdentity("ActivePresenceUpdateTrigger") .WithSimpleSchedule(o => o .WithIntervalInMinutes(1) @@ -96,21 +87,19 @@ public static class ScheduledJobsConfiguration .UsingJobData("stage", nameof(PresenceUpdateStage.Active)) ); - var maybePresenceUpdateJob = new JobKey("MaybePresenceUpdate"); - q.AddJob(opts => opts.WithIdentity(maybePresenceUpdateJob)); + q.AddJob(opts => opts.WithIdentity("MaybePresenceUpdate")); q.AddTrigger(opts => opts - .ForJob(maybePresenceUpdateJob) + .ForJob("MaybePresenceUpdate") .WithIdentity("MaybePresenceUpdateTrigger") .WithSimpleSchedule(o => o - .WithIntervalInMinutes(3) + .WithIntervalInMinutes(5) .RepeatForever()) .UsingJobData("stage", nameof(PresenceUpdateStage.Maybe)) ); - var coldPresenceUpdateJob = new JobKey("ColdPresenceUpdate"); - q.AddJob(opts => opts.WithIdentity(coldPresenceUpdateJob)); + q.AddJob(opts => opts.WithIdentity("ColdPresenceUpdate")); q.AddTrigger(opts => opts - .ForJob(coldPresenceUpdateJob) + .ForJob("ColdPresenceUpdate") .WithIdentity("ColdPresenceUpdateTrigger") .WithSimpleSchedule(o => o .WithIntervalInMinutes(10)