fix: response need delay total

This commit is contained in:
viletyy 2022-07-19 09:54:48 +08:00
parent 2b3875be66
commit 3d0e6d927a
3 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
gitea-client (0.9.0) gitea-client (0.10.0)
rest-client (~> 2.1.0) rest-client (~> 2.1.0)
GEM GEM

View File

@ -104,7 +104,11 @@ module Gitea
response.return! response.return!
end end
JSON.parse(response) rescue {} if response.headers.has_key?(:x_total)
return {data: JSON.parse(response), total_data: response.headers[:x_total]}
else
return JSON.parse(response)
end rescue {}
end end
def get_user_agent def get_user_agent

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module Gitea module Gitea
VERSION = "0.9.0" VERSION = "0.10.0"
end end