Skip to content

Commit

Permalink
Don't try to kill if nothing was forgotten
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Koch committed Oct 17, 2015
1 parent 1b17e1a commit 55050dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contrib/find_forgotten_procs.py
Expand Up @@ -200,13 +200,14 @@ def main(command, tron_base, *target_service_names, **options):
)

pprint(results)
print "Total instances", sum(
forgotten_count = sum(
len(pids)
for service_pid_pairs in results.itervalues()
for _, pids in service_pid_pairs
)
print "Total instances", forgotten_count

if command == 'kill':
if forgotten_count and command == 'kill':
execute(
parallel(kill_forgotten),
results,
Expand Down

0 comments on commit 55050dc

Please sign in to comment.