public async Task ProcessAcync(Commit commit)
        {
            var    filesToRetreive = commit.Added.Union(commit.Modified);
            string baseUrl         = _config.BaseDownloadUrl;

            foreach (var file in filesToRetreive)
            {
                if (_procesed.Contains(file))
                {
                    continue;
                }

                var url  = $@"{baseUrl}/{file}";
                var data = await GetFileAsync(url);

                await _files.CreateOrUpdateAsync(file, data);

                _procesed.Add(file);
            }

            foreach (var file in commit.Removed)
            {
                await _files.DeleteAsync(file);
            }
        }
Beispiel #2
0
        public async Task ProcessAsync(Commit commit)
        {
            var filesToRetrieve = commit.Added.Union(commit.Modified);
            var baseUrl         = "https://raw.githubusercontent.com/jwmcpeak/hookrepo/master";

            foreach (var file in filesToRetrieve)
            {
                if (_processed.Contains(file))
                {
                    continue;
                }

                var url  = $@"{baseUrl}/{file}";
                var data = await GetFileAsync(url);

                await _files.CreateOrUpdateAsync(file, data);

                _processed.Add(file);
            }

            foreach (var file in commit.Removed)
            {
                await _files.DeleteAsync(file);
            }
        }