プロジェクト

全般

プロフィール

Vote #74005

未完了

Redmine email reminders sending 4 emails everytime cron runs

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
急いで
担当者:
-
カテゴリ:
Email notifications_9
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
9
version_id:
0
issue_org_id:
14251
author_id:
72817
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
71
ステータス-->[New]

説明

Hi, this is my environment
Environment:
Redmine version 2.3.1.stable
Ruby version 1.9.3 (x86_64-linux)
Rails version 3.2.13
Environment production
Database adapter Mysql2

Centos 6.3 (Final)

My Cron
*/5 * * * * . /var/www/html/redmine/redmine_fetch_imap //works fine
0 7 * * mon,tue,wed,thu,fri . /var/www/html/redmine/redmine_send_reminders > /var/www/html/redmine/reminders.log 2>&1 this one sends 4 emails each time it runs (or runs 4 times?)

Anyone having this issue?


journals

Definitely runs only once, but sends out 4 emails each time it runs.
--------------------------------------------------------------------------------
same effect on _Windows Server_ and _Redmine 1.4.0_

<pre>
D:\redmine\apps\redmine\htdocs>rake redmine:send_reminders days=1 users="3" RAILS_ENV="production" --trace
Please install RDoc 2.4.2+ to generate documentation.
** Invoke redmine:send_reminders (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:send_reminders
</pre>

-> sends *3x* Mails with same value

Can´t see why. Seems all alright in *mailer.rb*:
<pre>
# Sends reminders to issue assignees
# Available options:
# * :days => how many days in the future to remind about (defaults to 7)
# * :tracker => id of tracker for filtering issues (defaults to all trackers)
# * :project => id or identifier of project to process (defaults to all projects)
# * :users => array of user ids who should be reminded
def self.reminders(options={})
days = options[:days] || 7
project = options[:project] ? Project.find(options[:project]) : nil
tracker = options[:tracker] ? Tracker.find(options[:tracker]) : nil
user_ids = options[:users]

scope = Issue.open.scoped(:conditions => ["#{Issue.table_name}.assigned_to_id IS NOT NULL" +
" AND #{Project.table_name}.status = #{Project::STATUS_ACTIVE}" +
" AND #{Issue.table_name}.due_date = ?", days.day.from_now.to_date]
)
scope = scope.scoped(:conditions => {:assigned_to_id => user_ids}) if user_ids.present?
scope = scope.scoped(:conditions => {:project_id => project.id}) if project
scope = scope.scoped(:conditions => {:tracker_id => tracker.id}) if tracker

issues_by_assignee = scope.all(:include => [:status, :assigned_to, :project, :tracker]).group_by(&:assigned_to)
issues_by_assignee.each do |assignee, issues|
deliver_reminder(assignee, issues, days) if assignee.is_a?(User) && assignee.active?
end
end
</pre>

btw: SMTP Server is in local network (tried _exchange server_ and _hamster_ )
--------------------------------------------------------------------------------

Admin Redmine さんが約2年前に更新

  • カテゴリEmail notifications_9 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0