Exemple #1
0
        // Please set the following connection strings in app.config for this WebJob to run:
        // AzureWebJobsDashboard and AzureWebJobsStorage
        static void Main()
        {
            var config = new JobHostConfiguration();

            config.UseTimers();
            if (config.IsDevelopment)
            {
                config.UseDevelopmentSettings();
            }

            Console.WriteLine("Starting WebJob");
            _engine = new InitializationEngine((IEnumerable <IInitializableModule>)null, HostType.WebApplication, new AssemblyList(true).AllowedAssemblies);
            Console.WriteLine("Episerver Initialization");
            _engine.Initialize();

            var cancellationToken = new WebJobsShutdownWatcher().Token;

            cancellationToken.Register(() =>
            {
                Console.WriteLine("Episerver Uninitialization");
                _engine.Uninitialize();
            });

            var host = new JobHost(config);

            // The following code ensures that the WebJob will be running continuously
            host.RunAndBlock();
        }
Exemple #2
0
        public static void Cleanup()
        {
            if (InitializationEngine.InitializationState == InitializationState.Initialized)
            {
                InitializationEngine.Uninitialize();
            }

            DatabaseHelper.DropDatabasesIfTheyExist();
        }
Exemple #3
0
 public void Dispose()
 {
     // Take down the CMS instance
     if (_engine.InitializationState == InitializationState.Initialized)
     {
         _engine.Uninitialize();
     }
     // Removes the temporary database
     _database.Dispose();
 }
 private void Uninitialize()
 {
     _engine.Uninitialize();
 }
Exemple #5
0
 public void Stop()
 {
     _engine.Uninitialize();
 }