File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 6
6
# User packages
7
7
PKGS_PATH = "site/wwwroot/.python_packages"
8
8
VENV_PKGS_PATH = "site/wwwroot/worker_venv"
9
+ WORKER_DIR = "azure_functions_worker"
9
10
10
11
PKGS = "lib/site-packages"
11
12
@@ -50,18 +51,20 @@ def determine_user_pkg_paths():
50
51
51
52
if __name__ == '__main__' :
52
53
# worker.py lives in the same directory as azure_functions_worker
54
+ current_dir = str (Path (__file__ ).absolute ())
55
+ worker_path = os .path .join (current_dir , WORKER_DIR )
53
56
func_worker_dir = str (Path (__file__ ).absolute ().parent )
54
57
env = os .environ
55
58
56
59
# Setting up python path for all environments to prioritize
57
60
# third-party user packages over worker packages in PYTHONPATH
58
61
user_pkg_paths = determine_user_pkg_paths ()
59
62
joined_pkg_paths = os .pathsep .join (user_pkg_paths )
60
- env ['PYTHONPATH' ] = f'{ joined_pkg_paths } :{ func_worker_dir } '
63
+ env ['PYTHONPATH' ] = f'{ worker_path } : { joined_pkg_paths } :{ func_worker_dir } '
61
64
62
65
if is_azure_environment ():
63
66
os .execve (sys .executable ,
64
- [sys .executable , '-m' , 'azure_functions_worker' ]
67
+ [sys .executable , '-m' , WORKER_DIR ]
65
68
+ sys .argv [1 :],
66
69
env )
67
70
else :
You can’t perform that action at this time.
0 commit comments