-
Notifications
You must be signed in to change notification settings - Fork 198
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 --oldest and --clear features to prioritize
#851
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can i haz rst docs? also changelog?
it would be nice to be able to see what the oldest N jobs are before they are prioritized. I'm also a little unsure how to promote/explain the oldest jobs functionality so that it gets used appropriately. should we add a repeat command to the control panel that calls it once a ?
local job = df.global.world.jobs.list | ||
while ( job.next ) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider
for _,job in utils.listpairs(df.global.world.jobs.list) do
job
here is link.item
, and it takes care of the initial nil for you so you don't have to check for nil
@@ -479,6 +506,13 @@ end | |||
local function parse_commandline(args) | |||
local opts, action, unit_labors, reaction_names = {}, status, nil, nil | |||
local positionals = argparse.processArgsGetopt(args, { | |||
{'o', 'oldest', hasArg=true, handler=function(arg) | |||
action = boost_oldest | |||
opts.oldest_count = arg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using argparse.nonnegativeInt()
to validate arg
local job = df.global.world.jobs.list | ||
while ( job.next ) do | ||
job = job.next | ||
if (job.item and not job.item.flags.do_now and job.item.order_id == -1) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this excludes manager orders. should it also exclude repeat jobs? what about jobs that already have a worker attached and are in progress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it probably should preclude repeat jobs, i don't use those in my forts except very rarely so it did not come up for me
the others are also good ideas
all of these are "maybe? dunno yet, need more experiences" to tell, i'm still experimenting with numbers to use here a reporting tool might be a good idea, but i'm not sure how to go about that i have a separate script that does something along these lines but it is very much not ready to be shared with the community |
No description provided.