我在android应用程序上的云代码(解析)有问题。
根据sashido上的日志,云代码执行了几次(在几分钟内大约执行了五次),尽管它应该只执行一次。在androidstudio中,我收到一条错误消息。
云代码:
Parse.Cloud.define("incrementUserMinusOne", function(request, response) {
const User = new Parse.User();
const query = new Parse.Query(User);
// Finds the user by its ID
query.get(request.params.userId).then((user) => {
// Updates the data we want
user.increment('points', -1);
// Saves the user with the updated data
user.save(null, {useMasterKey: true })
.then((response) => {
console.info("incrementUserMinusOne " +
request.params.userId);
})
.catch((error) => {
console.error("incrementUserMinusOne " +
request.params.userId + error);
});
});
});
java代码:
HashMap<String, Object> params2 = new HashMap<String, Object>();
params2.put("userId", stringImageUserId);
ParseCloud.callFunctionInBackground(
"incrementUserPlusThreeTwo",
params2,
new FunctionCallback<Float>() {
@Override
public void done(Float object, ParseException e) {
if (e == null) {
} else {
e.printStackTrace();
}
}
}
);
在androidstudio上记录消息:
W/mebase.memebas: Accessing hidden method
Lcom/android/org/conscrypt/ConscryptEngineSocket;->setUseSessionTickets(Z)V
(blacklist,core-platform-api, reflection, denied) W/mebase.memebas:
Accessing hidden method
Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setUseSessionTickets(Z)V
(greylist-max-q,core-platform-api, reflection, denied)
Accessing hidden method Lcom/android/org/conscrypt/AbstractConscryptSocket;->setUseSessionTickets(Z)V
(greylist-max-q, reflection, denied)
Accessing hidden method Lcom/android/org/conscrypt/ConscryptEngineSocket;->setHostname(Ljava/lang/String;)V
(blacklist,core-platform-api, reflection, denied)
Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setHostname(Ljava/lang/String;)V
(greylist-max-q,core-platform-api, reflection, denied)
Accessing hidden method Lcom/android/org/conscrypt/AbstractConscryptSocket;->setHostname(Ljava/lang/String;)V
(greylist-max-q, reflection, denied)
Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V
(greylist-max-q,core-platform-api, reflection, denied)
Accessing hidden method Lcom/android/org/conscrypt/AbstractConscryptSocket;->setAlpnProtocols([B)V
(greylist-max-q, reflection, denied) W/mebase.memebas: Accessing hidden method
Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B
(greylist-max-q,core-platform-api, reflection, denied)
Accessing hidden method Lcom/android/org/conscrypt/AbstractConscryptSocket;->getAlpnSelectedProtocol()[B
(greylist-max-q, reflection, denied) V/31232: fehler W/System.err:
com.parse.ParseRequest$ParseRequestException: i/o failure
W/System.err:
at com.parse.ParseRequest.newTemporaryException(ParseRequest.java:288)
at com.parse.ParseRequest$2.then(ParseRequest.java:142)
at com.parse.ParseRequest$2.then(ParseRequest.java:136)
at bolts.Task$15.run(Task.java:917)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.net.SocketTimeoutException: timeout
at okio.Okio$4.newTimeoutException(Okio.java:232)
at okio.AsyncTimeout.exit(AsyncTimeout.java:285)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:354)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:226)
at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:215)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
W/System.err: at
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) W/System.err: at
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at com.parse.ParsePlugins$1.intercept(ParsePlugins.java:135)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
at okhttp3.RealCall.execute(RealCall.java:92)
at com.parse.ParseHttpClient.executeInternal(ParseHttpClient.java:70)
at com.parse.ParseHttpClient.execute(ParseHttpClient.java:56)
at com.parse.ParseRequest$3.then(ParseRequest.java:133)
at com.parse.ParseRequest$3.then(ParseRequest.java:130)
at bolts.Task$15.run(Task.java:917)
at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
at bolts.Task.completeAfterTask(Task.java:908)
at bolts.Task.continueWithTask(Task.java:715)
at bolts.Task.continueWithTask(Task.java:726)
at bolts.Task$13.then(Task.java:818)
at bolts.Task$13.then(Task.java:806)
... 4 more
Caused by: java.net.SocketException: Socket closed
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readFromSocket(ConscryptEngineSocket.java:928)
at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:892)
at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readUntilDataAvailable(ConscryptEngineSocket.java:807)
W/System.err: at
com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.read(ConscryptEngineSocket.java:780)
W/System.err: at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
... 37 more
暂无答案!
目前还没有任何答案,快来回答吧!