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

Background job to pull jobs from removes older saved jobs #14

Closed
willywos opened this issue Oct 5, 2018 · 6 comments
Closed

Background job to pull jobs from removes older saved jobs #14

willywos opened this issue Oct 5, 2018 · 6 comments

Comments

@willywos
Copy link
Owner

willywos commented Oct 5, 2018

There is a background job that runs on a heroku scheduler that calls the rake task rake jobby_job:process_job_sites. This basically removes that are a month old and pulls them from the job boards. The removal of older postings is done to keep the database from getting very large.

To Reproduce
Steps to reproduce the behavior:

  1. Run $ rake jobby_job:process_job_sites
  2. Create a user and login
  3. Scroll down to the last jobs and save some
  4. Run $ rake jobby_job:clear_job_sites
  5. Click on My Jobs and the jobs are gone.

Expected behavior
My Jobs should not be removed.

Additional context
I think the best option is to change how jobs are saved. Maybe updating the saved_jobs table to store the job posting information instead of the reference to the id of the job post. This way all the data is still saved and can be queried against. Then updating the My Jobs page to pull job postings from the information saved in saved_jobs.

@neeraj-joshi01
Copy link

Hey @willywos
I'll take it up
Will fix it over the weekend

@willywos
Copy link
Owner Author

willywos commented Oct 5, 2018

Thanks @neeraj-joshi01.

Let me know if you have any questions or need any clarifications.

@neeraj-joshi01
Copy link

@willywos Have submitted the PR: #23
I have added the is_saved column to job posting and have added a check to clear only unsaved jobs in the rake task rake jobby_job:clear_job_sites

@willywos
Copy link
Owner Author

willywos commented Oct 7, 2018

Hey @neeraj-joshi01 thanks for taking a look at this one. I'm unsure of this approach though. I had a couple of questions.

  1. If another user saves a job, does that mean that the job is going to show up for all users even after the posting becomes older than a month because it's been flagged as saved for one user?

  2. The alternative to this approach, the one I mentioned above in the additional context. What are you thoughts on doing that instead? Could add some columns to the saved jobs table and basically make a copy of it that's associated to the user. Then would just have to update the my jobs page to pull from that location instead of job postings.

Thanks

@neeraj-joshi01
Copy link

@willywos Adding columns to an existing table are pretty straightforward, But I wanted to avoid duplications while saving the same job details in multiple tables
Right now, there's no check on the jobs being shown on the Dashboard to any user (The system will show up jobs (a month old) to a user if those are there in the Database)
How about going ahead with my approach and adding a check to show only jobs published in the last month to a user?

@willywos
Copy link
Owner Author

willywos commented Oct 8, 2018

@neeraj-joshi01 ok well lets try it out and see how it goes.

@willywos willywos closed this as completed Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants