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

Show job priority in Jobs page and listjobs.json #343

Closed
wants to merge 4 commits into from

Conversation

my8100
Copy link
Collaborator

@my8100 my8100 commented Jun 24, 2019

This PR is created as schedule.json accepts parameter priority in PR #161.

@my8100
Copy link
Collaborator Author

my8100 commented Jun 24, 2019

The Jobs page

image
image
image

Output of listjobs.json

{'node_name': 'hostname',
 'status': 'ok',
 'pending': [{'project': 'TESTING2',
   'spider': 'test',
   'id': '-1',
   'priority': -1.0},
  {'project': 'TESTING2', 'spider': 'test', 'id': '-2', 'priority': -2.0}],
 'running': [{'project': 'TESTING',
   'spider': 'test',
   'id': '-2',
   'priority': -2.0,
   'pid': 115780,
   'start_time': '2019-06-24 18:34:51.158649'},
  {'project': 'TESTING2',
   'spider': 'test',
   'id': '2',
   'priority': 2.0,
   'pid': 26548,
   'start_time': '2019-06-24 18:34:56.168935'},
  {'project': 'TESTING2',
   'spider': 'test',
   'id': '1',
   'priority': 1.0,
   'pid': 18600,
   'start_time': '2019-06-24 18:35:01.951266'},
  {'project': 'TESTING2',
   'spider': 'test',
   'id': '0',
   'priority': 0.0,
   'pid': 38252,
   'start_time': '2019-06-24 18:35:06.158507'}],
 'finished': [{'project': 'TESTING',
   'spider': 'test',
   'id': '1',
   'priority': 1.0,
   'start_time': '2019-06-24 18:32:41.167214',
   'end_time': '2019-06-24 18:34:49.547557'},
  {'project': 'TESTING',
   'spider': 'test',
   'id': '2',
   'priority': 2.0,
   'start_time': '2019-06-24 18:32:46.197501',
   'end_time': '2019-06-24 18:34:54.385833'},
  {'project': 'TESTING',
   'spider': 'test',
   'id': '0',
   'priority': 0.0,
   'start_time': '2019-06-24 18:32:51.171786',
   'end_time': '2019-06-24 18:34:59.517127'},
  {'project': 'TESTING',
   'spider': 'test',
   'id': '-1',
   'priority': -1.0,
   'start_time': '2019-06-24 18:32:56.163071',
   'end_time': '2019-06-24 18:35:05.510470'}]}

@my8100
Copy link
Collaborator Author

my8100 commented Jun 24, 2019

I would update the test cases ASAP.

@codecov
Copy link

codecov bot commented Jun 24, 2019

Codecov Report

Merging #343 into master will decrease coverage by 0.04%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #343      +/-   ##
==========================================
- Coverage   68.37%   68.32%   -0.05%     
==========================================
  Files          17       17              
  Lines         860      862       +2     
  Branches      104      104              
==========================================
+ Hits          588      589       +1     
- Misses        242      243       +1     
  Partials       30       30
Impacted Files Coverage Δ
scrapyd/website.py 59.57% <ø> (ø) ⬆️
scrapyd/webservice.py 29.41% <ø> (ø) ⬆️
scrapyd/poller.py 86.66% <100%> (+0.45%) ⬆️
scrapyd/spiderqueue.py 95.23% <100%> (ø) ⬆️
scrapyd/sqlite.py 88.88% <100%> (ø) ⬆️
scrapyd/launcher.py 43.2% <50%> (-0.55%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ff7c1c...91993bc. Read the comment docs.

@Digenis
Copy link
Member

Digenis commented Jun 24, 2019

It seems that there's no backward compatible way to include it anywhere at all.

@my8100
Copy link
Collaborator Author

my8100 commented Jun 24, 2019

What to backward compatible?

@Digenis
Copy link
Member

Digenis commented Jun 24, 2019

Anyone using a custom laucher, poller, spiderqueue, sqlitequeue will have their code broken.
It's been long since the last release. Let's make the transition smooth.
Let's release 1.3 without it and include it in 1.4

@my8100
Copy link
Collaborator Author

my8100 commented Jun 24, 2019

Any plan on the release of 1.3?
When and what new features (but not implemented yet) to be included?

@Digenis
Copy link
Member

Digenis commented Jun 24, 2019

@jpmckinney
Copy link
Contributor

jpmckinney commented Mar 8, 2023

Can do along with #272 (now #474), so closing here as there are conflicts and we'd need to make new commits either way.

@jpmckinney jpmckinney closed this Mar 8, 2023
@jpmckinney
Copy link
Contributor

jpmckinney commented Mar 8, 2023

To add some detail to this comment:

Anyone using a custom laucher, poller, spiderqueue, sqlitequeue will have their code broken.

This PR would require changing these interfaces:

  • ISpiderQueue.list to return a list of (msg, priority) tuples instead of a list of msg.
  • ISpiderQueue.pop to return a (msg, priority) tuple instead of a msg.
  • IPoller.next to return a dict with a _priority key.

There's no actual problem with launcher, and "sqlitequeue" (presumably SqliteSpiderQueue) implements ISpiderQueue, so it has no additional problems to the above.

Edit: So, considering there was no demand expressed via a feature request, I'll just abandon this PR rather than try to make it part of #474.

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 this pull request may close these issues.

None yet

3 participants