Skip to content

Commit

Permalink
Fix disabling of instance caching for proxy tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Aug 26, 2023
1 parent d4b12ff commit 2751204
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions law/task/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

import shlex

from law.task.base import BaseTask, Task
import six

from law.task.base import BaseRegister, BaseTask, Task
from law.parameter import TaskInstanceParameter
from law.parser import global_cmdline_args
from law.util import quote_cmd
Expand All @@ -20,15 +22,21 @@
_forward_sandbox_attributes = {"input", "output", "run"}


class ProxyTask(BaseTask):
class ProxyRegister(BaseRegister):
"""
Meta class for proxy tasks with the sole purpose of disabling instance caching.
"""

task = TaskInstanceParameter()

exclude_params_req = {"task"}
# disable instance caching
ProxyRegister.disable_instance_cache()


# disable instance caching
ProxyTask.disable_instance_cache()
class ProxyTask(six.with_metaclass(ProxyRegister, BaseTask)):

task = TaskInstanceParameter()

exclude_params_req = {"task"}


class ProxyCommand(object):
Expand Down

0 comments on commit 2751204

Please sign in to comment.