You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
db.execute("UPDATE `table_resumable_table` SET extra='"+ extra.toJSON() +"', process="+ process +" WHERE `key`='"+ key +"' and `filepath`='"+ filepath +"'");
145
+
}
146
+
publicvoidonSuccess(JSONObjectobj) {
147
+
// 上传成功,删除记录
148
+
db.execute("DELETE FROM `table_resumable_table` WHERE `key`='"+ key +"' and `filepath`='"+ filepath +"'");
149
+
}
150
+
publicvoidonProcess(intcurrent, inttotal) {
151
+
process = current*100/total;
152
+
// 每5%持久化一次
153
+
if (process - lastPersistProcess >PERSIST_PACE) {
154
+
persist();
155
+
lastPersistProcess = process;
156
+
}
157
+
}
158
+
publicvoidonFailure(Exceptionex) {
159
+
// 忽略处理exception,
160
+
persist();
161
+
}
162
+
})
163
+
```
164
+
165
+
续传恢复
166
+
```java
167
+
JSONObject ret =db.GetOne("SELECT * FROM `table_resumable_table` LIMIT 0, 1");
168
+
PutExtra extra =newPutExtra(ret.optString("extraJson", ""));
0 commit comments