public async Task Run([TimerTrigger(Every15Minutes)] TimerInfo timer) { if (!_featureToggle.IsCosmosDynamicScalingEnabled()) { return; } try { await _scalingService.ScaleDownForJobConfiguration(); } catch (Exception exception) { _logger.Error(exception, "An error occurred getting message from timer job: on-scale-down-cosmosdb-collection"); throw; } }
public async Task Run([ServiceBusTrigger( ServiceBusConstants.TopicNames.JobNotifications, ServiceBusConstants.TopicSubscribers.ScaleUpCosmosdbCollection, Connection = ServiceBusConstants.ConnectionStringConfigurationKey)] Message message) { if (_featureToggle.IsCosmosDynamicScalingEnabled()) { try { _correlationIdProvider.SetCorrelationId(message.GetCorrelationId()); await _scalingService.ScaleUp(message); } catch (Exception exception) { _logger.Error(exception, $"An error occurred getting message from queue: {ServiceBusConstants.TopicSubscribers.ScaleUpCosmosdbCollection}"); throw; } } }