From 031ad5fb0818543a02fbbf9dc6ef690fdf3b5c9c Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 24 Apr 2024 11:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=97=A5=E5=BF=97=E4=B8=AD?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E6=8C=89commit=20date?= =?UTF-8?q?=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/commit_logs_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/commit_logs_controller.rb b/app/controllers/commit_logs_controller.rb index c3bbf9c1..3c0ad6bf 100644 --- a/app/controllers/commit_logs_controller.rb +++ b/app/controllers/commit_logs_controller.rb @@ -19,9 +19,10 @@ class CommitLogsController < ApplicationController params[:commits].each do |commit| commit_id = commit[:id] message = commit[:message] + commit_date = Time.parse(commit[:timestamp]) || Time.now commit_log = CommitLog.create(user: user, project: project, repository_id: repository_id, name: repository_name, full_name: repository_full_name, - ref: ref, commit_id: commit_id, message: message) + ref: ref, commit_id: commit_id, message: message, created_at: commit_date, updated_at: commit_date) commit_log.project_trends.create(user_id: user.id, project_id: project&.id, action_type: "create") if user.id !=2 # 统计数据新增 CacheAsyncSetJob.perform_later("project_common_service", {commits: 1}, project.id)