Fix the issue of UserIdentity loss
This commit is contained in:
parent
45341eb02e
commit
0302ccc9c5
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BotSharp.Core.Crontab.Abstraction
|
||||
{
|
||||
public interface ICrontabAuthenticationHook
|
||||
{
|
||||
void SetUserIdentity(CrontabItem item);
|
||||
}
|
||||
}
|
||||
|
|
@ -115,7 +115,11 @@ public class CrontabService : ICrontabService, ITaskFeeder
|
|||
public async Task ScheduledTimeArrived(CrontabItem item)
|
||||
{
|
||||
_logger.LogDebug($"ScheduledTimeArrived {item}");
|
||||
|
||||
HookEmitter.Emit<ICrontabAuthenticationHook>(_services, hook =>
|
||||
{
|
||||
hook.SetUserIdentity(item);
|
||||
});
|
||||
|
||||
await HookEmitter.Emit<ICrontabHook>(_services, async hook =>
|
||||
{
|
||||
if (hook.Triggers == null || hook.Triggers.Contains(item.Title))
|
||||
|
|
|
|||
Loading…
Reference in a new issue