when i was send request with for i in 0..<2 {Alamofire.request(.....)}
cxr0715 opened this issue · 3 comments
cxr0715 commented
kjessup commented
Are you using a global MySQL connection or sharing them amongst threads in any way? Sharing one connection is definitely not thread-safe.
cxr0715 commented
but I use MySQLManager connected is Singleton whit thread-safe
class MySQLManager {
var mysql : MySQL!
static let shareInstance : MySQLManager = {
let instance = MySQLManager()
let testHost = "127.0.0.1"
let testUser = "root"
let testPassword = "********"
let testDB = "********"
instance.mysql = MySQL()
let connected = instance.mysql.connect(host: testHost, user: testUser, password: testPassword, db: testDB)
if connected {
print("connectedSuccess")
} else {
print("connectedError")
}
guard connected else {
print(instance.mysql.errorMessage())
return instance
}
return instance
}()
private init(){}
}
kuhl commented
A "use of undeclared type" usually means you have a linker error. Check your target. I don't think this is an issue in Perfect. Please close.