2010-10-11 92 views
1

我以前有一個郵寄者設置爲將電子郵件發送給所有用戶帳戶。但現在我試圖調試它。所以我徹底解決了它,並且仍然發送電子郵件給我。Delayed_Jobs不會刷新

我完全沒有任何理由或理解爲什麼。瘋狂! :d

控制器

def org_blast_send 
    Delayed::Job.enqueue OrgBlast.new(params[:subject], params[:editor1]) 
    redirect_to org_blast_admin_email_blast_path 
end 

org_blast.rb

class OrgBlast < Struct.new(:subject, :editor1) 
    def perform 
    # You see? There is absolute nothing here but it still sends an email. 
    # However, if I rename this file, the website fails looking for it. 
    end 
end 

notifier.rb

def org_blast(org, subject, message) 
    subject subject 
    from NOTIFIER_EMAIL 
    recipients org.users.first.email 
    sent_on Time.zone.now 
    body :user => org.users.first.first_name + ' ' + org.users.first.last_name, :message => message 
    content_type "text/html" 
end 

回答

3

如果您正在運行ning delayed_jobs on your local,it must stop and restarted,it will ,儘管代碼在上次啓動時會執行代碼中的任何操作。

>> script/delayed_job stop 
>> script/delayed_job start 
+0

0123因爲有時候在問這個問題時有助於理解問題;-) – hurikhan77 2010-10-11 17:56:25

+0

......有時候問這個問題有助於你理解問題! – zetetic 2010-10-11 19:19:21

+0

我正在研究一個Web應用程序,它會告訴你你對未來所說的話。這樣所有的答案都更加個性化。瞭解與量子物理和時間擴展有關的任何紅寶石寶石嗎? – Trip 2010-10-11 19:45:12