fix: webhook tasks list error delay
This commit is contained in:
parent
7fde1e0e12
commit
84f12adce8
|
@ -1,7 +1,6 @@
|
||||||
class Gitea::WebhookTask < Gitea::Base
|
class Gitea::WebhookTask < Gitea::Base
|
||||||
serialize :payload_content, JSON
|
serialize :payload_content, JSON
|
||||||
serialize :request_content, JSON
|
serialize :request_content, JSON
|
||||||
serialize :response_content, JSON
|
|
||||||
|
|
||||||
self.inheritance_column = nil
|
self.inheritance_column = nil
|
||||||
|
|
||||||
|
@ -10,4 +9,10 @@ class Gitea::WebhookTask < Gitea::Base
|
||||||
belongs_to :webhook, class_name: "Gitea::Webhook", foreign_key: :hook_id
|
belongs_to :webhook, class_name: "Gitea::Webhook", foreign_key: :hook_id
|
||||||
|
|
||||||
enum type: {gogs: 1, slack: 2, gitea: 3, discord: 4, dingtalk: 5, telegram: 6, msteams: 7, feishu: 8, matrix: 9}
|
enum type: {gogs: 1, slack: 2, gitea: 3, discord: 4, dingtalk: 5, telegram: 6, msteams: 7, feishu: 8, matrix: 9}
|
||||||
|
|
||||||
|
def response_content_json
|
||||||
|
JSON.parse(response_content)
|
||||||
|
rescue
|
||||||
|
{}
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -1,5 +1,6 @@
|
||||||
json.total_count @tasks.total_count
|
json.total_count @tasks.total_count
|
||||||
json.tasks @tasks.each do |task|
|
json.tasks @tasks.each do |task|
|
||||||
json.(task, :id, :type, :uuid, :is_succeed, :is_delivered, :payload_content, :request_content, :response_content)
|
json.(task, :id, :event_type, :type, :uuid, :is_succeed, :is_delivered, :payload_content, :request_content)
|
||||||
|
json.response_content task.response_content_json
|
||||||
json.delivered_time Time.at(task.delivered*10**-9).strftime("%Y-%m-%d %H:%M:%S")
|
json.delivered_time Time.at(task.delivered*10**-9).strftime("%Y-%m-%d %H:%M:%S")
|
||||||
end
|
end
|
Loading…
Reference in New Issue