File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+ from crawlee ._utils .crypto import crypto_random_object_id
4
+
3
5
4
6
def generate_unique_resource_name (label : str ) -> str :
5
7
"""Generates a unique resource name, which will contain the given label."""
6
8
name_template = 'python-sdk-tests-{}-generated-{}'
7
9
template_length = len (name_template .format ('' , '' ))
8
10
api_name_limit = 63
9
- label_length_limit = api_name_limit - template_length
11
+ generated_random_id_length = 8
12
+ label_length_limit = api_name_limit - template_length - generated_random_id_length
10
13
11
14
label = label .replace ('_' , '-' )
12
15
assert len (label ) <= label_length_limit , f'Max label length is { label_length_limit } , but got { len (label )} '
13
16
14
- return name_template .format (label , template_length )
17
+ return name_template .format (label , crypto_random_object_id ( generated_random_id_length ) )
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ async def main() -> None:
250
250
'Accessed with the same client, should be False'
251
251
)
252
252
253
- actor = await make_actor (label = 'rq-multiple- clients-resurrection' , main_func = main )
253
+ actor = await make_actor (label = 'rq-clients-resurrection' , main_func = main )
254
254
run_result = await run_actor (actor )
255
255
assert run_result .status == 'SUCCEEDED'
256
256
You can’t perform that action at this time.
0 commit comments