public void HandleEvent(BanUserEvent @event) { var redis = _redisHelper.GetDatabase(); var batch = redis.CreateBatch(); var tasks = new Task[] { batch.SetAddAsync(string.Format(KEY_USER_ALL_BAN_USERS_FMT, @event.SUID), @event.TUID), batch.HashIncrementAsync(string.Format(KEY_USER_INFO_FMT, @event.SUID), F_S_BANS) }; batch.Execute(); Task.WaitAll(tasks); }
public bool UnBanEvent([FromBody] BanUserEvent banUserEvent) { try { _banService.UnBanUserEvent(banUserEvent.UserId); return(true); } catch (Exception e) { Console.WriteLine(e); } return(false); }