private async Task Tick() { while (_running) { try { _log.LogInformation("Daemon ticked"); if (_busy) { return; } _busy = true; _repositoryCleaner.Clean(); _indexService.PurgeOldArchives(); } finally { _busy = false; await Task.Delay(_tickInterval); } } }
public ActionResult Clean() { _repositoryCleaner.Clean(); _indexService.PurgeOldArchives(); return(new JsonResult(new { success = new { description = "Clean complete" } })); }
public void BasicClean() { // create a file and write to repository using path convention of path/to/file/bin. File is // not linked to any package string contentPath = CreateRepoContent(); // ensure file exists Assert.True(File.Exists(contentPath)); // assert file is gone after cleaning repo _respositoryCleaner.Clean(); Assert.False(File.Exists(contentPath)); }