Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: key not found: :retain_row_count #235

Closed
bjeanes opened this issue Jan 25, 2021 · 0 comments · Fixed by #236
Closed

KeyError: key not found: :retain_row_count #235

bjeanes opened this issue Jan 25, 2021 · 0 comments · Fixed by #236

Comments

@bjeanes
Copy link
Contributor

bjeanes commented Jan 25, 2021

The Que::Scheduler::Jobs::QueSchedulerAuditClearDownJob tries to pull the row count from passed options with :retain_row_count, a Symbol:

retain_row_count = options.fetch(:retain_row_count)

I'm not sure if this is due to something ActiveJob is messing with (even though it seems this job is not wrapped by ActiveJob's JobWrapper).

The example from the project README defines the schedule in the YAML file with a string key:

que-scheduler/README.md

Lines 194 to 197 in 2f7f93c

Que::Scheduler::Jobs::QueSchedulerAuditClearDownJob:
cron: "0 0 * * *"
args:
retain_row_count: 129600

At least in my project and configuration, defining this with a Symbol key specifically is forbidden by Psych:

Que::Scheduler::Jobs::QueSchedulerAuditClearDownJob:
  cron: "0 0 * * *"
  args:
    :retain_row_count: 129600

causes a Psych::DisallowedClass: Tried to load unspecified class: Symbol.

Perhaps I am missing something obvious here, but I think this clear job may have been written assuming a hash with indifferent access or Hashie or something, but this assumption doesn't seem to hold true (at least in all circumstances).

Perhaps the job could be adjusted to check for both a Symbol and a String key, esp given #214 and #207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant