mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
make temp scrape endpoint available only on debug
so I don't have to comment/uncomment all the time...
This commit is contained in:
parent
81b27866af
commit
b11ea298e8
2 changed files with 6 additions and 2 deletions
|
|
@ -16,9 +16,12 @@ public ScrapeController(ScrapeService scrapeService)
|
|||
[HttpPost]
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
//TODO: convert endpoint into scheduled job, don't expose on prod
|
||||
//await scrapeService.Scrape();
|
||||
#if DEBUG
|
||||
await scrapeService.Scrape(5);
|
||||
return Ok();
|
||||
#else
|
||||
return StatusCode(403);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ public ScrapeService(FilterListsDbContext filterListsDbContext)
|
|||
this.filterListsDbContext = filterListsDbContext;
|
||||
}
|
||||
|
||||
//TODO: call via scheduled job
|
||||
public async Task Scrape(int numberLists)
|
||||
{
|
||||
var lists = filterListsDbContext.FilterLists.OrderBy(x => x.ScrapedDateUtc).Take(numberLists)
|
||||
|
|
|
|||
Loading…
Reference in a new issue