Esempio n. 1
0
        public ActionResult <bool> SyncData(int?film = null, bool canIsertedCharacters = false, bool canIsertedPlanets = false, bool canIsertedStarships = false, bool canIsertedSpecies = false, bool canIsertedVehicles = false)
        {
            try
            {
                _taskQueue.QueueBackgroundWorkItem(async cancellationToken =>
                {
                    await _repository.FillDataText(film, canIsertedCharacters, canIsertedPlanets, canIsertedStarships, canIsertedSpecies, canIsertedVehicles);
                });

                return(Ok());
            }
            catch (Exception ex)
            {
                _logger.LogError($"Error: Controller exception sync data");
                return(StatusCode((int)HttpStatusCode.InternalServerError, new { Error = ex.Message }));
            }
        }