Пример #1
0
        public async Task <string> RegisterNewRequestAsync(string preassignedId = null)
        {
            var resId = preassignedId ?? Guid.NewGuid().ToString("N");

            var statusKey = _redis.Db().Hash(CreateKeyName(resId, "status"));

            var initialStatus = new RequestStatus
            {
                Step = ProcessStep.Pending
            };

            await initialStatus.WriteToRedis(statusKey);

            await statusKey.ExpireAsync(_options.MaxIdleTime);

            return(resId);
        }