Example #1
0
        public async Task Execute()
        {
            var instance = await GetOfflineNonFarmInstance();

            //TODO: refactor
            FarmService.DeleteInstance(_context, instance);

            await _context.SaveChangesAsync();
        }
Example #2
0
        public async Task Execute()
        {
            var offlineInstances = await GetOfflineInstances();

            //TODO: refactor
            offlineInstances.ForEach(i => FarmService.DeleteInstance(_context, i));

            if (offlineInstances.Count > 0)
            {
                _logger.LogDebug($"Deleting {offlineInstances.Count} instances which aren't connected");

                await _context.SaveChangesAsync();
            }
        }