Skip to content

Commit 4f67cf5

Browse files
authored
Merge pull request #7 from sevenfiftyhq/no-repeat-should-run
Get pending job list from the session during authentication
2 parents 16c100a + cade53c commit 4f67cf5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/qbwc/controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def authenticate
119119
ticket = QBWC.storage_module::Session.new(username, company_file_path).ticket
120120
session = get_session(ticket)
121121

122-
if !QBWC.pending_jobs(company_file_path, session).present?
122+
if !session.pending_jobs.any?
123123
QBWC.logger.info "Authentication of user '#{username}' succeeded, but no jobs pending for '#{company_file_path}'."
124124
company_file_path = AUTHENTICATE_NO_WORK
125125
else

lib/qbwc/session.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ def destroy
109109
@@session = nil
110110
end
111111

112+
def pending_jobs
113+
@pending_jobs ||= QBWC.pending_jobs(@company, self)
114+
end
115+
112116
protected
113117

114118
attr_accessor :current_job, :iterator_id
@@ -122,10 +126,6 @@ def reset(reset_job = false)
122126
return self.current_job
123127
end
124128

125-
def pending_jobs
126-
@pending_jobs ||= QBWC.pending_jobs(@company, self)
127-
end
128-
129129
def complete_with_success
130130
QBWC.session_complete_success.call(self) if QBWC.session_complete_success
131131
end

0 commit comments

Comments
 (0)