diff --git a/NumberSearch.Mvc/Controllers/PortingController.cs b/NumberSearch.Mvc/Controllers/PortingController.cs index 79e0bdf7..7b941510 100644 --- a/NumberSearch.Mvc/Controllers/PortingController.cs +++ b/NumberSearch.Mvc/Controllers/PortingController.cs @@ -35,7 +35,7 @@ public PortingController(IConfiguration config) { configuration = config; _postgresql = configuration.GetConnectionString("PostgresqlProd"); - _teleToken = Guid.Parse(configuration.GetConnectionString("TeleAPI")); + var checkTeli = Guid.TryParse(configuration.GetConnectionString("TeleAPI"), out _teleToken); _data247username = config.GetConnectionString("Data247Username"); _data247password = config.GetConnectionString("Data247Password"); _bulkVSAPIKey = config.GetConnectionString("BulkVSAPIKEY"); diff --git a/NumberSearch.Mvc/WorkerServices/MonitorLoop.cs b/NumberSearch.Mvc/WorkerServices/MonitorLoop.cs index 4da9fd1f..33abb864 100644 --- a/NumberSearch.Mvc/WorkerServices/MonitorLoop.cs +++ b/NumberSearch.Mvc/WorkerServices/MonitorLoop.cs @@ -46,7 +46,7 @@ public MonitorLoop(IBackgroundTaskQueue taskQueue, _taskQueue = taskQueue; _cancellationToken = applicationLifetime.ApplicationStopping; _configuration = configuration; - _teleToken = Guid.Parse(configuration.GetConnectionString("TeleAPI")); + var checkTeli = Guid.TryParse(configuration.GetConnectionString("TeleAPI"), out _teleToken); _postgresql = _configuration.GetConnectionString("PostgresqlProd"); _ = int.TryParse(_configuration.GetConnectionString("CallFlow"), out _CallFlow); _ = int.TryParse(_configuration.GetConnectionString("ChannelGroup"), out _ChannelGroup);