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

Add option to preserve ids that are provided as arguments with --prepare-jobs #836

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/urlwatch/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ def test_filter(self, id):
return 0

def prepare_jobs(self):
new_jobs = []
new_jobs = set()
for idx, job in enumerate(self.urlwatcher.jobs):
has_history = self.urlwatcher.cache_storage.has_history_data(job.get_guid())
if not has_history:
logger.info('Add Job: %s', job.pretty_name())
new_jobs.append(idx + 1)
if not new_jobs:
new_jobs.add(idx + 1)
if not new_jobs and not self.urlwatch_config.idx_set:
return 0
self.urlwatch_config.idx_set = frozenset(new_jobs)
self.urlwatch_config.idx_set = self.urlwatch_config.idx_set.union(new_jobs)
self.urlwatcher.run_jobs()
self.urlwatcher.close()

Expand Down
Loading