Beispiel #1
0
        public async Task <string> UpdateJobOptionsAsync(long id, UpdateJobOptionsDto dto)
        {
            await _client.GetGrain <IJobGrain>(id)
            .UpdateJobOptionsAsync(dto);

            return("success");
        }
Beispiel #2
0
        public async Task <ReturnDto <string> > UpdateJobOptionsInBufferAsync([FromRoute] long id,
                                                                              [FromBody][Required] UpdateJobOptionsDto dto, [FromRoute] Guid bufferId)
        {
            await _svc.UpdateJobOptionsAsync(id, dto, bufferId);

            return(new ReturnDto <string>("OK"));
        }
Beispiel #3
0
 public async Task UpdateJobOptionsAsync(UpdateJobOptionsDto dto)
 {
     if (State.CurrentJobState == JobState.WaitingForActivation)
     {
         throw new Exception($"job Id not exist: {this.GetPrimaryKeyLong()}");
     }
     State.Options = dto.Options;
     await WriteStateAsync();
 }
Beispiel #4
0
        public override async Task UpdateJobOptionsAsync(long id, UpdateJobOptionsDto dto)
        {
            var resp = await SendRequestAsync <string, UpdateJobOptionsDto>(HttpMethod.Put,
                                                                            $"api/jobTracker/updateOptions/{id}", dto);

            if (!resp.Result)
            {
                throw new Exception($"{nameof(UpdateJobOptionsAsync)} failed {resp.Msg}");
            }
        }
Beispiel #5
0
        internal override async Task UpdateJobOptionsWithBufferAsync(long id, UpdateJobOptionsDto dto, Guid bufferId)
        {
            var resp = await SendRequestAsync <string, UpdateJobOptionsDto>(HttpMethod.Put,
                                                                            $"api/bufferManager/{bufferId}/job/updateOptions/{id}", dto);

            if (!resp.Result)
            {
                throw new Exception($"{nameof(UpdateJobOptionsWithBufferAsync)} failed {resp.Msg}");
            }
        }
        public Task UpdateJobOptionsAsync(UpdateJobOptionsDto dto)
        {
            if (_state.CurrentJobState == JobState.WaitingForActivation)
            {
                throw new JobNotFoundException($"job Id not exist: {this.GetPrimaryKeyLong()}");
            }

            _state.Options = dto.Options;
            return(Task.CompletedTask);
        }
Beispiel #7
0
 public async Task <ReturnDto <string> > UpdateJobOptionsAsync([FromRoute] long id,
                                                               [FromBody][Required] UpdateJobOptionsDto dto)
 {
     return(new ReturnDto <string>(await _service.UpdateJobOptionsAsync(id, dto)));
 }
Beispiel #8
0
 internal abstract Task UpdateJobOptionsWithBufferAsync(long id, UpdateJobOptionsDto dto, Guid bufferId);
Beispiel #9
0
 public abstract Task UpdateJobOptionsAsync(long id, UpdateJobOptionsDto dto);
Beispiel #10
0
 public async Task UpdateJobOptionsAsync(long id, UpdateJobOptionsDto dto)
 {
     await _client.UpdateJobOptionsWithBufferAsync(id, dto, _scopeBufferId);
 }
Beispiel #11
0
 public async Task UpdateJobOptionsAsync(long id, UpdateJobOptionsDto dto, Guid bufferId)
 {
     RequestContext.Set(Constants.BufferIdKey, bufferId);
     var grain = _client.GetGrain <IJobGrainInMem>(id);
     await grain.UpdateJobOptionsAsync(dto);
 }