I've got an API built using ASP.NET Core 2.1 that does some basic CRUD operations.
This is some sort of a release pipeline application, dedicated to our internal processes. It works as follows:
- User requests a data reload (POST)
- User approves a data reload (POST)
- User kicks off SSIS package in database that will trigger that data reload (POST)
- Background process checks status of that SSIS package and when it completes will set state state of reload to done/failed
Our initial idea was to create a background service that would periodically query database and check what's the current status of SSIS package and then update our entity to desired state (done/failed).
However this does not work because every other service is scoped while background service is a singleton.
What could be an alternative to run that background service in order to maintain correct state of my entity? A separate project?