Skip to content

Commit 7c2c717

Browse files
authored
Merge pull request #426 from YangSen-qn/optimize-server-config
optimize: server config synchronizer
2 parents 06bddc9 + 2429979 commit 7c2c717

File tree

17 files changed

+163
-79
lines changed

17 files changed

+163
-79
lines changed

.github/workflows/ci-test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ on:
88
name: Run Test Cases
99
jobs:
1010
test-on-mac:
11-
runs-on: macos-10.15
11+
runs-on: macos-12
1212
steps:
1313
- name: Checkout repo
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515
with:
1616
ref: ${{ github.ref }}
17-
- name: Setup Ruby 2.6
18-
uses: actions/setup-ruby@v1
17+
- name: Setup Ruby 3.0
18+
uses: ruby/setup-ruby@v1
1919
with:
20-
ruby-version: '2.6'
20+
ruby-version: '3.0'
2121
- name: Setup Environment
2222
run: |
23-
gem install cocoapods --pre --quiet --silent --no-document
23+
gem install cocoapods --pre --no-document
2424
rm -rf $HOME/.cocoapods
2525
pod setup --silent
2626
pod install --silent --no-repo-update

QiniuDemo/QiniuDemo.xcodeproj/project.pbxproj

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
26F62ADDD5B6306E978C9A3F /* libPods-QiniuDemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14CB2139715DD7B6FD5B146E /* libPods-QiniuDemoTests.a */; };
1111
4561F02C28D9A6F80098A697 /* UploadResource_14M.zip in Resources */ = {isa = PBXBuildFile; fileRef = 4561F02B28D9A6F80098A697 /* UploadResource_14M.zip */; };
12+
45E6080929ADD57100634200 /* UploadResource_1G.zip in Resources */ = {isa = PBXBuildFile; fileRef = 45E6080829ADD57100634200 /* UploadResource_1G.zip */; };
1213
93D230241C86D7F700434F6D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D230231C86D7F700434F6D /* main.m */; };
1314
93D230271C86D7F700434F6D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D230261C86D7F700434F6D /* AppDelegate.m */; };
1415
93D2302A1C86D7F700434F6D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D230291C86D7F700434F6D /* ViewController.m */; };
@@ -42,6 +43,7 @@
4243
3189882026469145003CCA68 /* QiniuDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = QiniuDemo.entitlements; sourceTree = "<group>"; };
4344
4561F02B28D9A6F80098A697 /* UploadResource_14M.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = UploadResource_14M.zip; sourceTree = "<group>"; };
4445
4561F02F28D9AB090098A697 /* Configure.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Configure.h; sourceTree = "<group>"; };
46+
45E6080829ADD57100634200 /* UploadResource_1G.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = UploadResource_1G.zip; sourceTree = "<group>"; };
4547
6B9BC5A8D93F988C1240E05F /* libPods-QiniuDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-QiniuDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4648
93D2301F1C86D7F700434F6D /* QiniuDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QiniuDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
4749
93D230231C86D7F700434F6D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@@ -93,6 +95,7 @@
9395
4561F02A28D9A6F80098A697 /* DemoResource */ = {
9496
isa = PBXGroup;
9597
children = (
98+
45E6080829ADD57100634200 /* UploadResource_1G.zip */,
9699
4561F02B28D9A6F80098A697 /* UploadResource_14M.zip */,
97100
4561F02F28D9AB090098A697 /* Configure.h */,
98101
);
@@ -292,6 +295,7 @@
292295
buildActionMask = 2147483647;
293296
files = (
294297
93D230321C86D7F700434F6D /* LaunchScreen.storyboard in Resources */,
298+
45E6080929ADD57100634200 /* UploadResource_1G.zip in Resources */,
295299
4561F02C28D9A6F80098A697 /* UploadResource_14M.zip in Resources */,
296300
93D2302F1C86D7F700434F6D /* Assets.xcassets in Resources */,
297301
93D2302D1C86D7F700434F6D /* Main.storyboard in Resources */,
@@ -532,10 +536,13 @@
532536
INFOPLIST_FILE = QiniuDemo/Info.plist;
533537
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
534538
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
535-
PRODUCT_BUNDLE_IDENTIFIER = com.qiniu.QiniuDemo;
539+
PRODUCT_BUNDLE_IDENTIFIER = com.qiniu.demo;
536540
PRODUCT_NAME = "$(TARGET_NAME)";
537541
STRIP_SWIFT_SYMBOLS = YES;
538-
SUPPORTS_MACCATALYST = YES;
542+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
543+
SUPPORTS_MACCATALYST = NO;
544+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
545+
TARGETED_DEVICE_FAMILY = "1,2";
539546
};
540547
name = Debug;
541548
};
@@ -550,10 +557,13 @@
550557
INFOPLIST_FILE = QiniuDemo/Info.plist;
551558
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
552559
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
553-
PRODUCT_BUNDLE_IDENTIFIER = com.qiniu.QiniuDemo;
560+
PRODUCT_BUNDLE_IDENTIFIER = com.qiniu.demo;
554561
PRODUCT_NAME = "$(TARGET_NAME)";
555562
STRIP_SWIFT_SYMBOLS = YES;
556-
SUPPORTS_MACCATALYST = YES;
563+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
564+
SUPPORTS_MACCATALYST = NO;
565+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
566+
TARGETED_DEVICE_FAMILY = "1,2";
557567
};
558568
name = Release;
559569
};

QiniuDemo/QiniuDemo/Base.lproj/Main.storyboard

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="ICJ-el-kyi">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="ICJ-el-kyi">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment version="2048" identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
77
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
88
</dependencies>
99
<scenes>
@@ -12,7 +12,7 @@
1212
<objects>
1313
<navigationController id="ICJ-el-kyi" sceneMemberID="viewController">
1414
<navigationBar key="navigationBar" contentMode="scaleToFill" id="0Ga-mq-GEB">
15-
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
15+
<rect key="frame" x="0.0" y="48" width="414" height="44"/>
1616
<autoresizingMask key="autoresizingMask"/>
1717
</navigationBar>
1818
<connections>
@@ -36,7 +36,7 @@
3636
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
3737
<subviews>
3838
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f8h-Tl-cef">
39-
<rect key="frame" x="41.5" y="582" width="331" height="50"/>
39+
<rect key="frame" x="41.5" y="592" width="331" height="50"/>
4040
<color key="backgroundColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4141
<constraints>
4242
<constraint firstAttribute="height" constant="50" id="kgT-aZ-IJU"/>
@@ -64,13 +64,13 @@
6464
</connections>
6565
</button>
6666
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="PUC-cw-bND">
67-
<rect key="frame" x="20" y="202" width="374" height="249.5"/>
67+
<rect key="frame" x="20" y="206" width="374" height="249.5"/>
6868
<constraints>
6969
<constraint firstAttribute="width" secondItem="PUC-cw-bND" secondAttribute="height" multiplier="3:2" id="C8p-6F-bXA"/>
7070
</constraints>
7171
</imageView>
7272
<progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="F9t-wS-hHW">
73-
<rect key="frame" x="20" y="168" width="374" height="4"/>
73+
<rect key="frame" x="20" y="172" width="374" height="4"/>
7474
</progressView>
7575
</subviews>
7676
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -86,7 +86,7 @@
8686
<constraint firstItem="F9t-wS-hHW" firstAttribute="leading" secondItem="PUC-cw-bND" secondAttribute="leading" id="jiN-B0-534"/>
8787
<constraint firstAttribute="trailingMargin" secondItem="PUC-cw-bND" secondAttribute="trailing" id="k8E-N3-8Zw"/>
8888
<constraint firstItem="f8h-Tl-cef" firstAttribute="centerX" secondItem="UJS-dn-gjX" secondAttribute="centerX" id="pzZ-Ph-Td6"/>
89-
<constraint firstItem="Psn-X6-kmD" firstAttribute="top" secondItem="f8h-Tl-cef" secondAttribute="bottom" constant="30" id="sEq-Qn-Fuf"/>
89+
<constraint firstItem="Psn-X6-kmD" firstAttribute="top" secondItem="f8h-Tl-cef" secondAttribute="bottom" constant="20" id="sEq-Qn-Fuf"/>
9090
</constraints>
9191
</view>
9292
<tabBarItem key="tabBarItem" title="图片上传" id="NUn-lf-ojx"/>
@@ -100,7 +100,7 @@
100100
</viewController>
101101
<placeholder placeholderIdentifier="IBFirstResponder" id="0ur-tY-LLn" userLabel="First Responder" sceneMemberID="firstResponder"/>
102102
</objects>
103-
<point key="canvasLocation" x="-2316" y="-313"/>
103+
<point key="canvasLocation" x="-2417" y="-338"/>
104104
</scene>
105105
</scenes>
106106
</document>

QiniuDemo/QiniuDemo/Info.plist

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
66
<string>en</string>
7-
<key>NSPhotoLibraryUsageDescription</key>
8-
<string>App需要您的同意,才能访问相册</string>
97
<key>CFBundleExecutable</key>
108
<string>$(EXECUTABLE_NAME)</string>
119
<key>CFBundleIdentifier</key>
@@ -20,10 +18,6 @@
2018
<string>1.0</string>
2119
<key>CFBundleSignature</key>
2220
<string>????</string>
23-
<key>NSCameraUsageDescription</key>
24-
<string>App需要您的同意,才能访问相机</string>
25-
<key>NSMicrophoneUsageDescription</key>
26-
<string>App需要您的同意,才能访问麦克风</string>
2721
<key>CFBundleVersion</key>
2822
<string>1</string>
2923
<key>LSRequiresIPhoneOS</key>
@@ -33,6 +27,12 @@
3327
<key>NSAllowsArbitraryLoads</key>
3428
<true/>
3529
</dict>
30+
<key>NSCameraUsageDescription</key>
31+
<string>App需要您的同意,才能访问相机</string>
32+
<key>NSMicrophoneUsageDescription</key>
33+
<string>App需要您的同意,才能访问麦克风</string>
34+
<key>NSPhotoLibraryUsageDescription</key>
35+
<string>App需要您的同意,才能访问相册</string>
3636
<key>UILaunchStoryboardName</key>
3737
<string>LaunchScreen</string>
3838
<key>UIMainStoryboardFile</key>

QiniuDemo/QiniuDemo/ViewController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ - (void)viewDidLoad {
5858
self.title = @"七牛云上传";
5959
}
6060

61-
- (IBAction)chooseAction:(id)sender {
61+
- (IBAction)chooseAction:(UIButton *)sender {
6262
[self gotoImageLibrary];
6363
}
6464

@@ -72,7 +72,7 @@ - (IBAction)uploadAction:(UIButton *)sender {
7272
path = [[NSBundle mainBundle] pathForResource:@"UploadResource_14M.zip" ofType:nil];
7373
// path = [[NSBundle mainBundle] pathForResource:@"UploadResource_9M.zip" ofType:nil];
7474
// path = [[NSBundle mainBundle] pathForResource:@"UploadResource_49M.zip" ofType:nil];
75-
// path = [[NSBundle mainBundle] pathForResource:@"UploadResource_1.44G.zip" ofType:nil];
75+
// path = [[NSBundle mainBundle] pathForResource:@"UploadResource_1G.zip" ofType:nil];
7676

7777
// NSFileManager *manager = [NSFileManager defaultManager];
7878
// NSURL *desktopUrl = [manager URLsForDirectory:NSDesktopDirectory inDomains:NSUserDomainMask].firstObject;
@@ -141,8 +141,8 @@ - (void)uploadImageToQNFilePath:(NSString *)filePath complete:(dispatch_block_t)
141141
builder.retryMax = 1;
142142
// builder.useHttps = NO;
143143

144-
builder.useConcurrentResumeUpload = true;
145-
builder.concurrentTaskCount = 3;
144+
builder.useConcurrentResumeUpload = false;
145+
builder.concurrentTaskCount = 10;
146146
builder.resumeUploadVersion = QNResumeUploadVersionV2;
147147
builder.putThreshold = 4*1024*1024;
148148
builder.chunkSize = 1*1024*1024;

0 commit comments

Comments
 (0)