-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
40 lines (34 loc) · 890 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# SPDX-License-Identifier: BSD-2-Clause
#
# Rakefile
# Part of NetDEF CI System
#
# Copyright (c) 2023 by
# Network Device Education Foundation, Inc. ("NetDEF")
#
# frozen_string_literal: true
require 'bundler/setup'
require 'otr-activerecord'
load 'tasks/otr-activerecord.rake'
require_relative 'config/delayed_job'
require_relative 'config/setup'
namespace :jobs do
desc 'Clear the delayed_job queue.'
task :clear do
Delayed::Job.delete_all
end
desc 'Start a delayed_job worker.'
task :work do
puts "Starting delayed_job worker - Queues: #{ENV.fetch('QUEUES', 'default')}"
Delayed::Worker.new(
queue: ENV.fetch('QUEUES', 'default'),
quiet: false
).start
end
end
namespace :db do
# Some db tasks require your app code to be loaded; they'll expect to find it here
task :environment do
require_relative 'database_loader'
end
end