Skip to content

Commit a31565e

Browse files
authored
random priority (#376)
1 parent 4b106c7 commit a31565e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

gokart/task.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import hashlib
22
import inspect
33
import os
4+
import random
45
import types
56
from importlib import import_module
67
from logging import getLogger
@@ -86,6 +87,10 @@ class TaskOnKart(luigi.Task):
8687
)
8788
should_lock_run: bool = ExplicitBoolParameter(default=False, significant=False, description='Whether to use redis lock or not at task run.')
8889

90+
@property
91+
def priority(self):
92+
return random.Random().random() # seed is fixed, so we need to use random.Random().random() instead f random.random()
93+
8994
def __init__(self, *args, **kwargs):
9095
self._add_configuration(kwargs, 'TaskOnKart')
9196
# 'This parameter is dumped into "workspace_directory/log/task_log/" when this task finishes with success.'

0 commit comments

Comments
 (0)