os_log(.info,log:.debug,"%{public}s[%{public}ld], %{public}s: poll %s updated in the %.2fs. Skip for update",((#fileasNSString).lastPathComponent),#line,#function,poll.id,timeIntervalSinceUpdate)
returnnil
}
os_log(.info,log:.debug,"%{public}s[%{public}ld], %{public}s: poll %s info update…",((#fileasNSString).lastPathComponent),#line,#function,poll.id)
returnself.context.apiService.poll(
domain:toot.domain,
pollID:poll.id,
pollObjectID:poll.objectID,
mastodonAuthenticationBox:authenticationBox
)
}
.setFailureType(to:Error.self)
.switchToLatest()
.receive(on:DispatchQueue.main)
.sink(receiveCompletion:{completionin
switchcompletion{
case.failure(leterror):
os_log(.info,log:.debug,"%{public}s[%{public}ld], %{public}s: poll %s info fail to update: %s",((#fileasNSString).lastPathComponent),#line,#function,pollID??"?",error.localizedDescription)
case.finished:
break
}
},receiveValue:{responsein
letpoll=response.value
os_log(.info,log:.debug,"%{public}s[%{public}ld], %{public}s: poll %s info updated",((#fileasNSString).lastPathComponent),#line,#function,poll.id)