Skip to content

Commit 0522489

Browse files
committed
Update README.md
1 parent 30d36c2 commit 0522489

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ ResumableIO.put(key, InputStreamAt.fromFile(new File(filepath)), extra, new JSON
146146
db.execute("DELETE FROM `table_resumable_table` WHERE `key`='" + key + "' and `filepath`='" + filepath + "'");
147147
}
148148
public void onProcess(int current, int total) {
149-
process = current*100/total;
149+
int newProcess = current*100/total;
150150
// 每5%持久化一次
151-
if (process % 5 == 0) {
151+
if (newProcess % 5 == 0 && newProcess - process > 1) {
152152
persist();
153153
}
154+
process = newProcess;
154155
}
155156
public void onFailure(Exception ex) {
156157
// 忽略处理exception,

0 commit comments

Comments
 (0)