Skip to content

Commit

Permalink
Use a lighter way (POST /api/v0/id) to detect if IPFS is online
Browse files Browse the repository at this point in the history
  • Loading branch information
livid committed Jul 11, 2024
1 parent 0400532 commit 2fb6dea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Planet/IPFS/IPFSState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ class IPFSState: ObservableObject {

func updateStatus() async {
// verify webui online status
let url = URL(string: "http://127.0.0.1:\(self.apiPort)/webui")!
let request = URLRequest(
let url = URL(string: "http://127.0.0.1:\(self.apiPort)/api/v0/id")!
var request = URLRequest(
url: url,
cachePolicy: .reloadIgnoringLocalAndRemoteCacheData,
timeoutInterval: 5
)
request.httpMethod = "POST"
let onlineStatus: Bool
do {
let (_, response) = try await URLSession.shared.data(for: request)
Expand Down
2 changes: 1 addition & 1 deletion Planet/versioning.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 2129
CURRENT_PROJECT_VERSION = 2130

0 comments on commit 2fb6dea

Please sign in to comment.