refactoring
This commit is contained in:
@@ -17,11 +17,12 @@ public class HeartbeatBackgroundTask
|
||||
|
||||
public HeartbeatBackgroundTask(
|
||||
EpsonPrintServiceConfiguration configuration,
|
||||
ILogger logger)
|
||||
ILogger logger,
|
||||
HttpClient httpClient)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_logger = logger;
|
||||
_httpClient = new HttpClient();
|
||||
_httpClient = httpClient;
|
||||
_interval = TimeSpan.FromSeconds(30);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ var config = JsonSerializer.Deserialize<EpsonPrintServiceConfiguration>(
|
||||
File.ReadAllText("config.json"));
|
||||
|
||||
kernel.Bind<IDiscoveryService>().To<DiscoveryService>().InSingletonScope();
|
||||
kernel.Bind<HttpClient>().ToConstant(new HttpClient { Timeout = TimeSpan.FromSeconds(30) }).InSingletonScope();
|
||||
|
||||
|
||||
kernel.Bind<EpsonPrintServiceConfiguration>().ToConstant(config);
|
||||
|
||||
Reference in New Issue
Block a user