Open StiviiK opened 3 years ago
To which value you setted the shutdown timeout in host builder?
Currently the default value, but using for example 1s isn't changing the behaviour.
collection.Configure<HostOptions>(o => o.ShutdownTimeout = TimeSpan.FromSeconds(1));
Can you add a console log after await _host.StartAsync(); in OnStart?
Gets called:
[07:19:00] Loading resource test
Start
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /opt/altv
Started
[07:19:00] Loaded resource test
Seems good. But i dont know how hostbuilder works internally and i dont know If its possible to stop programmatically with that.
Okay, so this seems like a wont fix. I will look into it further and keep the issue updated. But I guess this won't really affect me very much.
I also started with HostBuilder and all the stuff, but this is wrong for working with altV. HostBuilder should be used in executing assemblies. Your module gets loaded by altv.exe and therefore should not implement HostBuilder.
Nevertheless, all the advantages can be used as standalone by your own (stuff like Configuration, Dependency Injection, Logging ...).
Note This is a carry-over from https://github.com/altmp/altv-issues/issues/707.
Client/server version
Build #1301, branch release
Current behavior When using the
HostBuilder
and aHostedService
the server stop gets stuck. Consider the following code:Produces the following output:
Context (environment) Currently only tested within a Docker Container, but this should not really matter.