Skip to content

Commit

Permalink
Merge pull request #426 from YangSen-qn/optimize-server-config
Browse files Browse the repository at this point in the history
optimize: server config synchronizer
  • Loading branch information
bachue authored Mar 28, 2023
2 parents 06bddc9 + 2429979 commit 7c2c717
Show file tree
Hide file tree
Showing 17 changed files with 163 additions and 79 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ on:
name: Run Test Cases
jobs:
test-on-mac:
runs-on: macos-10.15
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Setup Ruby 2.6
uses: actions/setup-ruby@v1
- name: Setup Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
ruby-version: '3.0'
- name: Setup Environment
run: |
gem install cocoapods --pre --quiet --silent --no-document
gem install cocoapods --pre --no-document
rm -rf $HOME/.cocoapods
pod setup --silent
pod install --silent --no-repo-update
Expand Down
18 changes: 14 additions & 4 deletions QiniuDemo/QiniuDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
26F62ADDD5B6306E978C9A3F /* libPods-QiniuDemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14CB2139715DD7B6FD5B146E /* libPods-QiniuDemoTests.a */; };
4561F02C28D9A6F80098A697 /* UploadResource_14M.zip in Resources */ = {isa = PBXBuildFile; fileRef = 4561F02B28D9A6F80098A697 /* UploadResource_14M.zip */; };
45E6080929ADD57100634200 /* UploadResource_1G.zip in Resources */ = {isa = PBXBuildFile; fileRef = 45E6080829ADD57100634200 /* UploadResource_1G.zip */; };
93D230241C86D7F700434F6D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D230231C86D7F700434F6D /* main.m */; };
93D230271C86D7F700434F6D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D230261C86D7F700434F6D /* AppDelegate.m */; };
93D2302A1C86D7F700434F6D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D230291C86D7F700434F6D /* ViewController.m */; };
Expand Down Expand Up @@ -42,6 +43,7 @@
3189882026469145003CCA68 /* QiniuDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = QiniuDemo.entitlements; sourceTree = "<group>"; };
4561F02B28D9A6F80098A697 /* UploadResource_14M.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = UploadResource_14M.zip; sourceTree = "<group>"; };
4561F02F28D9AB090098A697 /* Configure.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Configure.h; sourceTree = "<group>"; };
45E6080829ADD57100634200 /* UploadResource_1G.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = UploadResource_1G.zip; sourceTree = "<group>"; };
6B9BC5A8D93F988C1240E05F /* libPods-QiniuDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-QiniuDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
93D2301F1C86D7F700434F6D /* QiniuDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QiniuDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
93D230231C86D7F700434F6D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -93,6 +95,7 @@
4561F02A28D9A6F80098A697 /* DemoResource */ = {
isa = PBXGroup;
children = (
45E6080829ADD57100634200 /* UploadResource_1G.zip */,
4561F02B28D9A6F80098A697 /* UploadResource_14M.zip */,
4561F02F28D9AB090098A697 /* Configure.h */,
);
Expand Down Expand Up @@ -292,6 +295,7 @@
buildActionMask = 2147483647;
files = (
93D230321C86D7F700434F6D /* LaunchScreen.storyboard in Resources */,
45E6080929ADD57100634200 /* UploadResource_1G.zip in Resources */,
4561F02C28D9A6F80098A697 /* UploadResource_14M.zip in Resources */,
93D2302F1C86D7F700434F6D /* Assets.xcassets in Resources */,
93D2302D1C86D7F700434F6D /* Main.storyboard in Resources */,
Expand Down Expand Up @@ -532,10 +536,13 @@
INFOPLIST_FILE = QiniuDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.qiniu.QiniuDemo;
PRODUCT_BUNDLE_IDENTIFIER = com.qiniu.demo;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_SWIFT_SYMBOLS = YES;
SUPPORTS_MACCATALYST = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -550,10 +557,13 @@
INFOPLIST_FILE = QiniuDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.qiniu.QiniuDemo;
PRODUCT_BUNDLE_IDENTIFIER = com.qiniu.demo;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_SWIFT_SYMBOLS = YES;
SUPPORTS_MACCATALYST = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand Down
16 changes: 8 additions & 8 deletions QiniuDemo/QiniuDemo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment version="2048" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -12,7 +12,7 @@
<objects>
<navigationController id="ICJ-el-kyi" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="0Ga-mq-GEB">
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<rect key="frame" x="0.0" y="48" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
Expand All @@ -36,7 +36,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f8h-Tl-cef">
<rect key="frame" x="41.5" y="582" width="331" height="50"/>
<rect key="frame" x="41.5" y="592" width="331" height="50"/>
<color key="backgroundColor" red="0.0" green="0.50196081400000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="kgT-aZ-IJU"/>
Expand Down Expand Up @@ -64,13 +64,13 @@
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="PUC-cw-bND">
<rect key="frame" x="20" y="202" width="374" height="249.5"/>
<rect key="frame" x="20" y="206" width="374" height="249.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="PUC-cw-bND" secondAttribute="height" multiplier="3:2" id="C8p-6F-bXA"/>
</constraints>
</imageView>
<progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="F9t-wS-hHW">
<rect key="frame" x="20" y="168" width="374" height="4"/>
<rect key="frame" x="20" y="172" width="374" height="4"/>
</progressView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand All @@ -86,7 +86,7 @@
<constraint firstItem="F9t-wS-hHW" firstAttribute="leading" secondItem="PUC-cw-bND" secondAttribute="leading" id="jiN-B0-534"/>
<constraint firstAttribute="trailingMargin" secondItem="PUC-cw-bND" secondAttribute="trailing" id="k8E-N3-8Zw"/>
<constraint firstItem="f8h-Tl-cef" firstAttribute="centerX" secondItem="UJS-dn-gjX" secondAttribute="centerX" id="pzZ-Ph-Td6"/>
<constraint firstItem="Psn-X6-kmD" firstAttribute="top" secondItem="f8h-Tl-cef" secondAttribute="bottom" constant="30" id="sEq-Qn-Fuf"/>
<constraint firstItem="Psn-X6-kmD" firstAttribute="top" secondItem="f8h-Tl-cef" secondAttribute="bottom" constant="20" id="sEq-Qn-Fuf"/>
</constraints>
</view>
<tabBarItem key="tabBarItem" title="图片上传" id="NUn-lf-ojx"/>
Expand All @@ -100,7 +100,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="0ur-tY-LLn" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-2316" y="-313"/>
<point key="canvasLocation" x="-2417" y="-338"/>
</scene>
</scenes>
</document>
12 changes: 6 additions & 6 deletions QiniuDemo/QiniuDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>App需要您的同意,才能访问相册</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand All @@ -20,10 +18,6 @@
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSCameraUsageDescription</key>
<string>App需要您的同意,才能访问相机</string>
<key>NSMicrophoneUsageDescription</key>
<string>App需要您的同意,才能访问麦克风</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand All @@ -33,6 +27,12 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>App需要您的同意,才能访问相机</string>
<key>NSMicrophoneUsageDescription</key>
<string>App需要您的同意,才能访问麦克风</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>App需要您的同意,才能访问相册</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
8 changes: 4 additions & 4 deletions QiniuDemo/QiniuDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ - (void)viewDidLoad {
self.title = @"七牛云上传";
}

- (IBAction)chooseAction:(id)sender {
- (IBAction)chooseAction:(UIButton *)sender {
[self gotoImageLibrary];
}

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

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

builder.useConcurrentResumeUpload = true;
builder.concurrentTaskCount = 3;
builder.useConcurrentResumeUpload = false;
builder.concurrentTaskCount = 10;
builder.resumeUploadVersion = QNResumeUploadVersionV2;
builder.putThreshold = 4*1024*1024;
builder.chunkSize = 1*1024*1024;
Expand Down
Loading

0 comments on commit 7c2c717

Please sign in to comment.