Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit edc0931

Browse files
Merge pull request #755 from github-for-unity/fixes/update-server
Use http everywhere
2 parents 0e5690e + 82624ae commit edc0931

File tree

4 files changed

+31
-10
lines changed

4 files changed

+31
-10
lines changed

src/GitHub.Api/Installer/GitInstaller.cs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,12 @@ private GitInstallationState GetZipsIfNeeded(GitInstallationState state)
218218
return state;
219219

220220
var downloader = new Downloader();
221-
downloader.Catch(e => true);
221+
downloader
222+
.Catch(e =>
223+
{
224+
LogHelper.Trace(e, "Failed to download");
225+
return true;
226+
});
222227
downloader.Progress(p => ((Progress)Progress)?.UpdateProgress(20 + (long)(20 * p.Percentage), 100, downloader.Name));
223228
if (!state.GitZipExists && !state.GitIsValid && state.GitPackage != null)
224229
downloader.QueueDownload(state.GitPackage.Uri, installDetails.ZipPath);
@@ -255,7 +260,11 @@ private GitInstallationState ExtractGit(GitInstallationState state)
255260
var unzipTask = new UnzipTask(cancellationToken, installDetails.GitZipPath,
256261
gitExtractPath, sharpZipLibHelper,
257262
environment.FileSystem)
258-
.Catch(e => true);
263+
.Catch(e =>
264+
{
265+
LogHelper.Trace(e, "Failed to unzip " + installDetails.GitZipPath);
266+
return true;
267+
});
259268
unzipTask.Progress(p => ((Progress)Progress)?.UpdateProgress(40 + (long)(20 * p.Percentage), 100, unzipTask.Name));
260269
var path = unzipTask.RunWithReturn(true);
261270
var target = state.GitInstallationPath;
@@ -276,7 +285,11 @@ private GitInstallationState ExtractGit(GitInstallationState state)
276285
var unzipTask = new UnzipTask(cancellationToken, installDetails.GitLfsZipPath,
277286
gitLfsExtractPath, sharpZipLibHelper,
278287
environment.FileSystem)
279-
.Catch(e => true);
288+
.Catch(e =>
289+
{
290+
LogHelper.Trace(e, "Failed to unzip " + installDetails.GitLfsZipPath);
291+
return true;
292+
});
280293
unzipTask.Progress(p => ((Progress)Progress)?.UpdateProgress(60 + (long)(20 * p.Percentage), 100, unzipTask.Name));
281294
var path = unzipTask.RunWithReturn(true);
282295
var target = state.GitLfsExecutablePath;
@@ -319,7 +332,7 @@ public class GitInstallDetails
319332
#if DEBUG
320333
private const string packageFeed = "http://localhost:50000/unity/git/";
321334
#else
322-
private const string packageFeed = "https://ghfvs-installer.github.com/unity/git/";
335+
private const string packageFeed = "http://github-vs.s3.amazonaws.com/unity/git/";
323336
#endif
324337

325338
private const string PackageVersion = "f02737a78695063deace08e96d5042710d3e32db";

src/GitHub.Api/Installer/OctorunInstaller.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ private bool IsOctorunExtracted()
8282

8383
public class OctorunInstallDetails
8484
{
85-
public const string DefaultZipMd5Url = "https://ghfvs-installer.github.com/unity/octorun/octorun.zip.md5";
86-
public const string DefaultZipUrl = "https://ghfvs-installer.github.com/unity/octorun/octorun.zip";
85+
public const string DefaultZipMd5Url = "http://github-vs.s3.amazonaws.com/unity/octorun/octorun.zip.md5";
86+
public const string DefaultZipUrl = "http://github-vs.s3.amazonaws.com/unity/octorun/octorun.zip";
8787

8888
public const string PackageVersion = "9fcd9faa";
8989
private const string PackageName = "octorun";

src/GitHub.Api/Primitives/Package.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ public static Package Load(IEnvironment environment, UriString packageFeed)
3333
if (!feed.FileExists() || now.Date > environment.UserSettings.Get<DateTimeOffset>(key).Date)
3434
{
3535
feed = new DownloadTask(TaskManager.Instance.Token, environment.FileSystem, packageFeed, environment.UserCachePath)
36-
.Catch(e => true)
37-
.RunWithReturn(true);
36+
.Catch(e =>
37+
{
38+
LogHelper.Trace(e, "Failed to download " + packageFeed);
39+
return true;
40+
})
41+
.RunWithReturn(true);
3842

3943
if (feed.IsInitialized)
4044
environment.UserSettings.Set<DateTimeOffset>(key, now);

src/UnityExtension/Assets/Editor/GitHub.Unity/UpdateCheck.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,18 @@ public class UpdateCheckWindow : EditorWindow
5454
#if DEBUG
5555
"http://localhost:50000/unity/latest.json"
5656
#else
57-
"https://ghfvs-installer.github.com/unity/latest.json"
57+
"http://github-vs.s3.amazonaws.com/unity/latest.json"
5858
#endif
5959
;
6060

6161
public static void CheckForUpdates()
6262
{
6363
var download = new DownloadTask(TaskManager.Instance.Token, EntryPoint.Environment.FileSystem, UpdateFeedUrl, EntryPoint.Environment.UserCachePath)
64-
.Catch(e => true);
64+
.Catch(e =>
65+
{
66+
LogHelper.Trace(e, "Failed to download " + UpdateFeedUrl);
67+
return true;
68+
});
6569
download.OnEnd += (thisTask, result, success, exception) =>
6670
{
6771
if (success)

0 commit comments

Comments
 (0)