Output progress in json2db
Signed-off-by: James Ketrenos <james_gitlab@ketrenos.com>
This commit is contained in:
parent
05afd4febd
commit
cc42b445eb
@ -158,7 +158,7 @@ int main(int argc, char *argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "DB opened.");
|
||||
fprintf(stderr, "DB opened.\n");
|
||||
|
||||
Face **ppFaces = malloc(sizeof(Face *) * entries);
|
||||
if (!ppFaces) {
|
||||
@ -221,6 +221,14 @@ int main(int argc, char *argv[]) {
|
||||
sqlite3_close(db);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (processed % 1000 == 0) {
|
||||
int perc = 100 * processed / entries;
|
||||
if (perc != last) {
|
||||
fprintf(stderr, "\rLoading %d%% complete.", perc);
|
||||
last = perc;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir(faceDir);
|
||||
}
|
||||
@ -235,5 +243,6 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
sqlite3_close(db);
|
||||
|
||||
fprintf(stderr, "\nDone.\n");
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user