Skip to content

Commit e004fb0

Browse files
committed
Revert worker.py combatilibity fix (not needed anymore)
Signed-off-by: Ankit Kumar <[email protected]>
1 parent 0d089b5 commit e004fb0

File tree

1 file changed

+2
-44
lines changed

1 file changed

+2
-44
lines changed

python/worker.py

+2-44
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,4 @@
1-
"""Main entrypoint."""
2-
3-
4-
try:
5-
from azure.functions_worker.main import main
6-
7-
except ImportError:
8-
# Compatibility with hard-bundled pre-beta worker versions in
9-
# deployed function apps.
10-
import argparse
11-
import traceback
12-
13-
def parse_args():
14-
parser = argparse.ArgumentParser(
15-
description='Python Azure Functions Worker')
16-
parser.add_argument('--host')
17-
parser.add_argument('--port', type=int)
18-
parser.add_argument('--workerId', dest='worker_id')
19-
parser.add_argument('--requestId', dest='request_id')
20-
parser.add_argument('--log-level', type=str, default='INFO',
21-
choices=['TRACE', 'INFO', 'WARNING', 'ERROR'],)
22-
parser.add_argument('--log-to', type=str, default=None,
23-
help='log destination: stdout, stderr, '
24-
'syslog, or a file path')
25-
parser.add_argument('--grpcMaxMessageLength', type=int,
26-
dest='grpc_max_msg_len')
27-
return parser.parse_args()
28-
29-
def main():
30-
args = parse_args()
31-
32-
import azure.functions # NoQA
33-
import azure.functions_worker
34-
from azure.functions_worker import aio_compat
35-
36-
try:
37-
return aio_compat.run(azure.functions_worker.start_async(
38-
args.host, args.port, args.worker_id, args.request_id,
39-
args.grpc_max_msg_len))
40-
except Exception:
41-
print(traceback.format_exc(), flush=True)
42-
raise
43-
1+
from azure.functions_worker import main
442

453
if __name__ == '__main__':
46-
main()
4+
main.main()

0 commit comments

Comments
 (0)