Skip to content

Commit 95bba71

Browse files
committed
add asyncConfiguration
1 parent 3f20f31 commit 95bba71

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Type: Application
22
Name: cdn-backup-origin
33
Provider:
44
- 阿里云
5-
Version: 0.1.3
5+
Version: 0.1.4
66
Description: 快速部署CDN备份源站项目到函数计算
77
HomePage: https://github.com/devsapp/cdn-backup-origin
88
Tags:

src/code/index.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,21 @@ def parse_url(url):
4848
# ('http://', '192.168.1.109:8080', '/abc/images/111/', 'index.html', 'html', '?a=1&b=2')
4949
if res is not None:
5050
path = res.group(3)
51-
full_path = res.group(1) + res.group(2) + res.group(3)
51+
protocol = res.group(1) if res.group(1) is not None else 'http://'
52+
full_path = protocol + res.group(2) + res.group(3)
5253

5354
if not path.endswith('/'):
5455
path = path + '/'
5556
full_path = full_path + '/'
5657
return dict(
57-
base_url=res.group(1) + res.group(2),
58-
full_path=full_path,
59-
protocol=res.group(1),
60-
domain=res.group(2),
61-
path=path,
62-
file_name=res.group(4),
63-
ext=res.group(5),
64-
params=res.group(6)
58+
base_url = protocol + res.group(2),
59+
full_path = full_path,
60+
protocol = protocol,
61+
domain = res.group(2),
62+
path = path,
63+
file_name = res.group(4),
64+
ext = res.group(5),
65+
params = res.group(6)
6566
)
6667

6768

src/s.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ services:
3434
runtime: python3
3535
timeout: 1200
3636
codeUri: ./code
37+
asyncConfiguration:
38+
maxAsyncEventAgeInSeconds: 1200
39+
maxAsyncRetryAttempts: 0
40+
statefulInvocation: true
3741
triggers:
3842
- name: cron
3943
type: timer

0 commit comments

Comments
 (0)