Browse Source

Increase timeout

master
boB Rudis 10 months ago
parent
commit
1deb3339f7
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
5 changed files with 25 additions and 15 deletions
  1. BIN
      RSwitch.xcworkspace/xcuserdata/hrbrmstr.xcuserdatad/UserInterfaceState.xcuserstate
  2. +15
    -11
      RSwitch/Swift/Downloaders/DownloadFromRStudioServer.swift
  3. +1
    -1
      RSwitch/Swift/Downloaders/DownloadRStudio.swift
  4. +2
    -1
      RSwitch/Swift/Downloaders/DownloadTarball.swift
  5. +7
    -2
      RSwitch/Swift/MenuActions/BrowseMenuAction.swift

BIN
RSwitch.xcworkspace/xcuserdata/hrbrmstr.xcuserdatad/UserInterfaceState.xcuserstate View File


+ 15
- 11
RSwitch/Swift/Downloaders/DownloadFromRStudioServer.swift View File

@ -15,17 +15,10 @@ func download_from_studio_server(fromRS : String, toFS : String) {
let rsURL = URL(string: fromRS)!
let fsURL = URL(string: toFS)!
if (FileManager.default.fileExists(atPath: fsURL.path)) {
NSLog("Deleting old file")
do {
try FileManager.default.removeItem(at: fsURL)
} catch {
NSLog("error deleting old file")
}
}
URLSession.shared.configuration.timeoutIntervalForRequest = 300.0
//URLSession.shared.downloadTask(with: <#T##URLRequest#>)
let task = URLSession.shared.downloadTask(with: rsURL) {
@ -41,6 +34,17 @@ func download_from_studio_server(fromRS : String, toFS : String) {
NSLog("We've got the data");
if (FileManager.default.fileExists(atPath: fsURL.path)) {
NSLog("Deleting old file")
do {
try FileManager.default.removeItem(at: fsURL)
} catch {
NSLog("error deleting old file")
}
}
do {
NSLog("Trying to move the data from \(localURL) to \(fsURL)");
try FileManager.default.moveItem(at: localURL, to: fsURL)


+ 1
- 1
RSwitch/Swift/Downloaders/DownloadRStudio.swift View File

@ -45,7 +45,7 @@ extension AppDelegate {
if (status < 300) {
guard let fileURL = tempURL else {
DispatchQueue.main.async { [weak self] in self?.rstudio_enabled = true }
DispatchQueue.main.async { [weak self] in self?.rstudio_enabled = true }
return
}


+ 2
- 1
RSwitch/Swift/Downloaders/DownloadTarball.swift View File

@ -9,7 +9,8 @@
import Foundation
import Cocoa
let tarballURL = "https://mac.r-project.org/el-capitan/R-devel/R-devel-el-capitan-sa-x86_64.tar.gz"
let tarballURL = "https://mac.r-project.org/high-sierra/R-devel/x86_64/R-devel.tar.gz"
//let tarballURL = "https://mac.r-project.org/el-capitan/R-devel/R-devel-el-capitan-sa-x86_64.tar.gz"
let tarballFile = NSString(string: tarballURL).lastPathComponent as String
extension AppDelegate {


+ 7
- 2
RSwitch/Swift/MenuActions/BrowseMenuAction.swift View File

@ -36,7 +36,10 @@ class BrowseMenuAction {
BrowseMenuAction(title: "R-devel News…", url: "https://developer.r-project.org/blosxom.cgi/R-devel/NEWS"),
BrowseMenuAction(title: "R-Forge macOS Subversion…", url: "http://svn.rforge.net/osx/trunk/"),
BrowseMenuAction(title: "R-Project R GUI Subversion…", url: "https://svn.r-project.org/R-packages/trunk/Mac-GUI/"),
BrowseMenuAction(title: "Bioconductor…", url: "https://www.bioconductor.org/")
BrowseMenuAction(title: "Bioconductor…", url: "https://www.bioconductor.org/"),
BrowseMenuAction(title: "gfortran for macOS…", url: "https://github.com/fxcoudert/gfortran-for-macOS/releases"),
BrowseMenuAction(title: "macOS dependent static libs for building R…", url: "https://mac.r-project.org/libs-4/"),
BrowseMenuAction(title: "Sources for tools and libraries…", url: "https://mac.r-project.org/src/")
]
private static let webItemsExt = [
@ -50,7 +53,9 @@ class BrowseMenuAction {
BrowseMenuAction(title: "Unofficial R-O GitHub CRAN Mirror…", url: "https://github.com/cran"),
BrowseMenuAction(title: "XQuartz (X11 for macOS)…", url: "https://www.xquartz.org/"),
BrowseMenuAction(title: "Homebrew (macOS Package Manager)…", url: "https://brew.sh/"),
BrowseMenuAction(title: "Apple Developer Portal…", url: "https://developer.apple.com/")
BrowseMenuAction(title: "OSGeo Homebrew tap…", url:"https://osgeo.github.io/homebrew-osgeo4mac/"),
BrowseMenuAction(title: "Apple Developer Portal…", url: "https://developer.apple.com/"),
BrowseMenuAction(title: "RStudio GitHub Issues…", url: "https://github.com/rstudio/rstudio/issues")
]
private static let webItemsMan = [


Loading…
Cancel
Save