Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
fixing style
Browse files Browse the repository at this point in the history
  • Loading branch information
badb committed Feb 24, 2019
1 parent 80007aa commit 64d4d2a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion golem/task/server/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _filter_options(_options):

options = _filter_options(options)

if size:
if size and options:
options.set(size=size)
return options

Expand Down
2 changes: 1 addition & 1 deletion golem/task/taskkeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def receive_subtask(self, task_to_compute: message.tasks.TaskToCompute):
comp_task_info.subtasks[subtask_id] = comp_task_def
header = self.get_task_header(task_id)
comp_task_info.keeping_deadline = comp_task_info_keeping_timeout(
header.subtask_timeout, task_to_compute.size)
header.subtask_timeout, task_to_compute.size)

self.subtask_to_task[subtask_id] = task_id
if task_to_compute.resources_options:
Expand Down
3 changes: 1 addition & 2 deletions golem/task/tasksession.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,7 @@ def _check_resource_size(self, resource_size):
max_resource_size = int(max_resource_size_kib) * 1024
if resource_size > max_resource_size:
logger.info('Subtask with too big resources received: '
f'{resource_size}, only {max_resource_size} available'
)
f'{resource_size}, only {max_resource_size} available')
return False
return True

Expand Down
3 changes: 2 additions & 1 deletion tests/golem/task/test_concent_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def setUp(self):
self.task_session.task_computer.has_assigned_task.return_value = False
self.task_session.task_server.keys_auth.ecc.raw_pubkey = \
self.keys.raw_pubkey
self.task_session.task_server.config_desc.max_resource_size = 1024 * 1024 * 1024 * 100
self.task_session.task_server.config_desc.max_resource_size = \
1024 * 1024 * 1024 * 100
self.task_session.task_server.task_keeper\
.task_headers[self.msg.task_id]\
.subtasks_count = 10
Expand Down
5 changes: 4 additions & 1 deletion tests/golem/task/test_taskkeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ def _dump_some_tasks(self, tasks_dir):
price_bid,
header.subtask_timeout,
)
ttc = msg_factories.tasks.TaskToComputeFactory(price=price, size=1024)
ttc = msg_factories.tasks.TaskToComputeFactory(
price=price,
size=1024
)
ttc.compute_task_def = ctd
ttc.resources_options = HyperdriveClientOptions(
HyperdriveClient.CLIENT_ID,
Expand Down

0 comments on commit 64d4d2a

Please sign in to comment.