Skip to content

Commit

Permalink
fixed job fails on quartz fire triggers
Browse files Browse the repository at this point in the history
Signed-off-by: TheBottleCyber <[email protected]>
  • Loading branch information
TheBottleCyber committed Feb 16, 2022
1 parent 8cb008c commit 31da462
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 0 additions & 8 deletions Leviathan.Bot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ await builder.Services.GetRequiredService<InteractionService>()

await _discordSocketClient.LoginAsync(TokenType.Bot, _settings.DiscordConfig.BotToken);
await _discordSocketClient.StartAsync();

while (true)
{
if (_discordSocketClient.ConnectionState == ConnectionState.Connected) break;
else Thread.Sleep(150);
}

await builder.RunAsync();
}
Expand Down Expand Up @@ -100,7 +94,6 @@ private void ConfigureServices(IServiceCollection services)
q.AddTrigger(t =>
t.WithIdentity("update_discord_names_trigger")
.ForJob(update_discord_names)
.StartNow()
.WithSimpleSchedule(x => x.RepeatForever().WithIntervalInMinutes(5))
);

Expand All @@ -109,7 +102,6 @@ private void ConfigureServices(IServiceCollection services)
q.AddTrigger(t =>
t.WithIdentity("update_discord_roles_trigger")
.ForJob(update_discord_roles)
.StartNow()
.WithSimpleSchedule(x => x.RepeatForever().WithIntervalInMinutes(5))
);

Expand Down
4 changes: 3 additions & 1 deletion Leviathan.Runner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public static async Task Main(string[] args)
Log.Warning("Please use this tool only for testing or when there is no possibility to create a service for linux/windows" +
" The runner can be unpredictable. This is the standard method of launching Leviathan without docker containers");

await Task.WhenAny(Web.Program.Main(args), Worker.Program.Main(args), Bot.Program.Main(args));
await Task.WhenAny(Bot.Program.Main(args), Web.Program.Main(args), Worker.Program.Main(args));

throw new ApplicationException("One of projects stopped");
}
}
}

0 comments on commit 31da462

Please sign in to comment.