0

Controller:

    class CronjobsController < ApplicationController
      def just_check
        meeting_id = 1
        UserMailer.upcoming_meeting_email_twelve_hours_before(meeting_id).deliver
      end
    end

Model:

    class Cronjob < ActiveRecord::Base
      def self.just_check
        meeting_id = "meeting.id"
        UserMailer.upcoming_meeting_email_twelve_hours_before(meeting_id).deliver
      end
    end

schedule.rb

    every 2.minute do
      runner "Cronjob.just_check", :environment => "development"
    end

But the issue is that after every 2 minutes runner is not able to call the models method.

Faisal Malik
  • 277
  • 3
  • 6

1 Answers1

0

Have you updated the crontab with the jobs in schedule.rb file.

Update the crontab with the following command

whenever --update-crontab --set environment=development

If you updated properly, then can u please past the jobs of crontab.

You can get the crontab jobs by crontab -l. And also check the log file for any error messages.

Sagar Bommidi
  • 1,409
  • 8
  • 12