diff --git a/lib/tasks/commit_log_to_db.rake b/lib/tasks/commit_log_to_db.rake index 359a844fc..2f29bee8f 100644 --- a/lib/tasks/commit_log_to_db.rake +++ b/lib/tasks/commit_log_to_db.rake @@ -29,7 +29,7 @@ namespace :commit_log_to_db do commit_sha = commit['sha'] next if CommitLog.find_by(commit_id: commit_sha).present? ref = "master" - commit_message = commit['commit']['message'].to_s.gsub("\"","") + commit_message = commit['commit']['message'].to_s.size > 2000 ? "Message Data too long" : commit['commit']['message'].to_s.gsub("/n","").gsub("\"","") user = User.find_by(mail: commiter['email']) user_id = user&.id || project.user_id commit_date = Time.parse(commit['commit']['author']['date']) @@ -65,7 +65,7 @@ namespace :commit_log_to_db do commit_sha = commit['sha'] next if CommitLog.find_by(commit_id: commit_sha).present? ref = "master" - commit_message = commit['commit']['message'].to_s.gsub("/n","").gsub("\"","") + commit_message = commit['commit']['message'].to_s.size > 2000 ? "Message Data too long" : commit['commit']['message'].to_s.gsub("/n","").gsub("\"","") user = User.find_by(mail: commiter['email']) user_id = user&.id || project.user_id commit_date = Time.parse(commit['commit']['author']['date'])