public metricsController()
        {
            string dataProviderArg = Environment.GetEnvironmentVariable("dataProvider");
            string connStringArg   = Environment.GetEnvironmentVariable("connectionString");
            string dbNameArg       = Environment.GetEnvironmentVariable("dbName");

            switch (dataProviderArg)
            {
            case "mongo":
                HangfireConfigurationProvider.GetMongoConfiguration(connStringArg, dbNameArg);
                break;

            case "sqlserver":
                HangfireConfigurationProvider.GetSqlServerConfiguration(connStringArg);
                break;

            case "redis":
                HangfireConfigurationProvider.GetRedisConfiguration(connStringArg);
                break;

            case "azureservicebusqueue":
                HangfireConfigurationProvider.GetAzureServiceBusQueueConfiguration(connStringArg);
                break;

            case "litedb":
                HangfireConfigurationProvider.GetLiteDBConfiguration(connStringArg);
                break;

            case "memorystorage":
                HangfireConfigurationProvider.GetMemoryStorageConfiguration();
                break;

            case "mysql":
                HangfireConfigurationProvider.GetMySqlConfiguration(connStringArg);
                break;

            case "postgres":
                HangfireConfigurationProvider.GetPostgresConfiguration(connStringArg);
                break;

            default:
                Console.WriteLine("Data Connection error. Please check connection string.");
                break;
            }

            api  = JobStorage.Current.GetMonitoringApi();
            data = new StringBuilder();
        }
Beispiel #2
0
        private static void ConnectDataStorage()
        {
            string dataProviderArg = Environment.GetEnvironmentVariable("dataProvider");
            string connStringArg   = Environment.GetEnvironmentVariable("connectionString");
            string dbNameArg       = Environment.GetEnvironmentVariable("dbName");

            switch (dataProviderArg)
            {
            case "mongo":
                HangfireConfigurationProvider.GetMongoConfiguration(connStringArg, dbNameArg);
                break;

            case "sqlserver":
                HangfireConfigurationProvider.GetSqlServerConfiguration(connStringArg);
                break;

            case "redis":
                HangfireConfigurationProvider.GetRedisConfiguration(connStringArg);
                break;

            case "azureservicebusqueue":
                HangfireConfigurationProvider.GetAzureServiceBusQueueConfiguration(connStringArg);
                break;

            case "litedb":
                HangfireConfigurationProvider.GetLiteDbConfiguration(connStringArg);
                break;

            case "memorystorage":
                HangfireConfigurationProvider.GetMemoryStorageConfiguration();
                break;

            case "mysql":
                HangfireConfigurationProvider.GetMySqlConfiguration(connStringArg);
                break;

            case "postgres":
                HangfireConfigurationProvider.GetPostgresConfiguration(connStringArg);
                break;

            default:
                Console.WriteLine("Data Connection error. Please check connection string.");
                break;
            }
        }