From 332f0235a05fb1027f366a500bbef12c795ed30a Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 14 Dec 2017 17:39:39 +0630 Subject: [PATCH] =?UTF-8?q?change=20channel=20to=20cron=E1=80=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/base_origami_controller.rb | 8 ++++---- app/jobs/checkin_job.rb | 2 +- config/schedule.rb | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/base_origami_controller.rb b/app/controllers/base_origami_controller.rb index 9a58c3fd..ec415bad 100755 --- a/app/controllers/base_origami_controller.rb +++ b/app/controllers/base_origami_controller.rb @@ -2,7 +2,7 @@ class BaseOrigamiController < ActionController::Base include LoginVerification layout "origami" - before_action :checkin_process + # before_action :checkin_process #before_action :check_installation protect_from_forgery with: :exception @@ -15,7 +15,7 @@ class BaseOrigamiController < ActionController::Base @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] end - def checkin_process - CheckinJob.set(wait: 1.minute).perform_later() - end + # def checkin_process + # CheckinJob.set(wait: 1.minute).perform_later() + # end end diff --git a/app/jobs/checkin_job.rb b/app/jobs/checkin_job.rb index 7cdb500c..298a42f5 100644 --- a/app/jobs/checkin_job.rb +++ b/app/jobs/checkin_job.rb @@ -1,7 +1,7 @@ class CheckinJob < ApplicationJob queue_as :default - def perform() + def self.perform() table = DiningFacility.get_checkin_booking if table.length > 0 ActionCable.server.broadcast "checkin_channel",table: table diff --git a/config/schedule.rb b/config/schedule.rb index 6a43ba25..17f336a0 100755 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -10,3 +10,6 @@ every 30.minutes do runner "Customer.update_membership" end +every 1.minutes do + runner "CheckinJob.perform" +end \ No newline at end of file