Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cancellation token #6

Open
shishnk opened this issue Apr 13, 2024 · 1 comment
Open

Fix cancellation token #6

shishnk opened this issue Apr 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@shishnk
Copy link
Owner

shishnk commented Apr 13, 2024

Investigate and resolve the issue with the cancellation token where it seems to be getting lost or not propagated correctly, causing requests to fail.

@shishnk shishnk added the bug Something isn't working label Apr 13, 2024
@TheActualTwinkle
Copy link

Устроил investigate , и...
Я (почти) уверен что дело в _settings.Token в TelegramCommandFactory.cs:82

command.SetHandler(async context =>
{
    var telegramId = context.ParseResult.GetValueForOption(_globalOption);
    var result = await telegramCommand.Execute(
        context,
        telegramId,
        GetValueForArgument,
        _bus,
        _cacheService,
        _messageService,
        _settings.Token);
    _results.TryAdd(telegramId, result.Value);
});

Следует передавать токен созданный в TelegramBot.cs:50

using var cts = new CancellationTokenSource(_settings.Timeout);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants