示例#1
0
        public async Task Run([TimerTrigger("0 */6 * * * *", RunOnStartup = true)] TimerInfo myTimer)
        {
            var cacheUpdateDisabled = _configuration[ConfigConstants.DISABLE_CACHE_UPDATE];

            if (!String.IsNullOrWhiteSpace(cacheUpdateDisabled) && cacheUpdateDisabled.ToLower() == "true")
            {
                _logger.LogWarning($"Cache update is disabled, aborting!");
                return;
            }

            await _virtualMachineSizeImportService.UpdateVmSizeCache();

            await _virtualMachineDiskSizeImportService.Import();
        }
示例#2
0
        public async Task <IActionResult> UpdateVmSizeCache(CancellationToken cancellationToken = default)
        {
            await _virtualMachineSizeImportService.UpdateVmSizeCache(cancellationToken);

            return(new NoContentResult());
        }