Exemplo n.º 1
0
        public override void OnStartup(PluginLifecycleContext context)
        {
            var settings = GlobalSettingManager.Instance;
            var url = settings.GetValue(SettingKeys.Url);

            if (!String.IsNullOrEmpty(url))
            {
                var interval = settings.TryGetValue<int>(SettingKeys.IntervalInMinutes, Constants.DefaultIntervalInMinutes);
                if (interval == 0)
                {
                    interval = Constants.DefaultIntervalInMinutes;
                }

                KeepAliveWorker.Start(url, TimeSpan.FromMinutes(interval));
            }
        }
Exemplo n.º 2
0
        public override void OnInstall(PluginLifecycleContext context)
        {
            using (var session = Database.OpenSession())
            {
                var conn = session.Connection;
                using (var cmd = conn.CreateCommand())
                {
                    cmd.CommandText = LoadInstallSql();

                    try
                    {
                        cmd.ExecuteNonQuery();
                    }
                    catch
                    {
                        // It might fail if the table already exists. Just ignore the exception for now.
                    }
                }
            }
        }
Exemplo n.º 3
0
 public override void OnStartup(PluginLifecycleContext context)
 {
     FileSystemProviders.Register(new QiniuFileSystemProvider());
 }
Exemplo n.º 4
0
 public override void OnDisable(PluginLifecycleContext context)
 {
     FileSystemProviders.Unregister(Strings.FileSystemProviderName);
 }
Exemplo n.º 5
0
 public override void OnStartup(PluginLifecycleContext context)
 {
     HttpProcessors.Processors.Insert(0, SitemapProcessor.Instance);
 }
Exemplo n.º 6
0
 public override void OnDisable(PluginLifecycleContext context)
 {
     HttpProcessors.Processors.Remove(SitemapProcessor.Instance);
 }
Exemplo n.º 7
0
 public override void OnDisable(PluginLifecycleContext context)
 {
     KeepAliveWorker.Stop(true);
 }