Пример #1
0
        /// <summary>
        /// Registers component's cron jobs.
        /// </summary>
        public void RegisterCronJobs()
        {
            log.Trace("()");

            List <CronJob> cronJobDefinitions = new List <CronJob>()
            {
                // Checks if any of the followers need to be refreshed.
                { new CronJob()
                  {
                      Name = "checkFollowersRefresh", StartDelay = 19 * 1000, Interval = 11 * 60 * 1000, HandlerAsync = CronJobHandlerCheckFollowersRefreshAsync
                  } },

                // Checks if any of the hosted identities expired and if so, it deletes them.
                { new CronJob()
                  {
                      Name = "checkExpiredHostedIdentities", StartDelay = 59 * 1000, Interval = 119 * 60 * 1000, HandlerAsync = CronJobHandlerCheckExpiredHostedIdentitiesAsync
                  } },

                // Checks if any of the neighbors expired and if so, it deletes them.
                // We want a certain delay here after the start of the server to allow getting fresh neighborhood information from the LOC server.
                // But if LOC server is not initialized by then, it does not matter, cleanup will be postponed.
                { new CronJob()
                  {
                      Name = "checkExpiredNeighbors", StartDelay = 5 * 60 * 1000, Interval = 31 * 60 * 1000, HandlerAsync = CronJobHandlerCheckExpiredNeighborsAsync
                  } },
            };

            Cron cron = (Cron)Base.ComponentDictionary[Cron.ComponentName];

            cron.AddJobs(cronJobDefinitions);

            log.Trace("(-)");
        }
        /// <summary>
        /// Registers component's cron jobs.
        /// </summary>
        public void RegisterCronJobs()
        {
            log.Trace("()");

            List <CronJob> cronJobDefinitions = new List <CronJob>()
            {
                // Refreshes profile server's IPNS record.
                { new CronJob()
                  {
                      Name = "ipnsRecordRefresh", StartDelay = 2 * 60 * 60 * 1000, Interval = 7 * 60 * 60 * 1000, HandlerAsync = CronJobHandlerIpnsRecordRefreshAsync
                  } },
            };

            Cron cron = (Cron)Base.ComponentDictionary[Cron.ComponentName];

            cron.AddJobs(cronJobDefinitions);

            log.Trace("(-)");
        }
Пример #3
0
        /// <summary>
        /// Registers component's cron jobs.
        /// </summary>
        public void RegisterCronJobs()
        {
            log.Trace("()");

            List <CronJob> cronJobDefinitions = new List <CronJob>()
            {
                // Checks if any of the opened TCP connections are inactive and if so, it closes them.
                { new CronJob()
                  {
                      Name = "checkInactiveClientConnections", StartDelay = 2 * 60 * 1000, Interval = 2 * 60 * 1000, HandlerAsync = CronJobHandlerCheckInactiveClientConnectionsAsync
                  } },
            };

            Cron cron = (Cron)Base.ComponentDictionary[Cron.ComponentName];

            cron.AddJobs(cronJobDefinitions);

            log.Trace("(-)");
        }
        /// <summary>
        /// Registers component's cron jobs.
        /// </summary>
        public void RegisterCronJobs()
        {
            log.Trace("()");

            List <CronJob> cronJobDefinitions = new List <CronJob>()
            {
                // Obtains fresh data from LOC server.
                { new CronJob()
                  {
                      Name = "refreshLocData", StartDelay = 67 * 60 * 1000, Interval = 601 * 60 * 1000, HandlerAsync = CronJobHandlerRefreshLocDataAsync
                  } },
            };

            Cron cron = (Cron)Base.ComponentDictionary[Cron.ComponentName];

            cron.AddJobs(cronJobDefinitions);

            log.Trace("(-)");
        }
Пример #5
0
        /// <summary>
        /// Registers component's cron jobs.
        /// </summary>
        public void RegisterCronJobs()
        {
            log.Trace("()");

            List <CronJob> cronJobDefinitions = new List <CronJob>()
            {
                // Deletes unused images from the images folder.
                { new CronJob()
                  {
                      Name = "deleteUnusedImages", StartDelay = 200 * 1000, Interval = 37 * 60 * 1000, HandlerAsync = CronJobHandlerDeleteUnusedImagesAsync
                  } },
            };

            Cron cron = (Cron)Base.ComponentDictionary[Cron.ComponentName];

            cron.AddJobs(cronJobDefinitions);

            log.Trace("(-)");
        }