Ejemplo n.º 1
0
 public async Task UpdateCpuCredits()
 {
     using (ServerStore.ContextPool.AllocateOperationContext(out TransactionOperationContext ctx))
         using (var newCredits = await ctx.ReadForMemoryAsync(RequestBodyStream(), "cpu-credits"))
         {
             var updated = JsonDeserializationServer.CpuCredits(newCredits);
             Server.CpuCreditsBalance.RemainingCpuCredits = updated.RemainingCredits;
         }
 }
Ejemplo n.º 2
0
 public Task UpdateCpuCredits()
 {
     using (ServerStore.ContextPool.AllocateOperationContext(out TransactionOperationContext ctx))
         using (var newCredits = ctx.ReadForDisk(RequestBodyStream(), "cpu-credits"))
         {
             var updated = JsonDeserializationServer.CpuCredits(newCredits);
             Server.CpuCreditsBalance.RemainingCpuCredits = updated.RemainingCredits;
             return(Task.CompletedTask);
         }
 }