mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-02 07:54:27 +00:00
Add log for packing dirs.
This commit is contained in:
@@ -1082,6 +1082,7 @@ access_zip_cb (evhtp_request_t *req, void *arg)
|
|||||||
json_t *info_obj = NULL;
|
json_t *info_obj = NULL;
|
||||||
json_error_t jerror;
|
json_error_t jerror;
|
||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
|
char *repo_id = NULL;
|
||||||
char *zip_file_path;
|
char *zip_file_path;
|
||||||
const char *error = NULL;
|
const char *error = NULL;
|
||||||
int error_code;
|
int error_code;
|
||||||
@@ -1138,7 +1139,9 @@ access_zip_cb (evhtp_request_t *req, void *arg)
|
|||||||
|
|
||||||
zip_file_path = zip_download_mgr_get_zip_file_path (seaf->zip_download_mgr, token);
|
zip_file_path = zip_download_mgr_get_zip_file_path (seaf->zip_download_mgr, token);
|
||||||
if (!zip_file_path) {
|
if (!zip_file_path) {
|
||||||
seaf_warning ("Failed to get zip file path for %s, token:[%s].\n", filename, token);
|
g_object_get (info, "repo_id", &repo_id, NULL);
|
||||||
|
seaf_warning ("Failed to get zip file path for %s in repo %.8s, token:[%s].\n",
|
||||||
|
filename, repo_id, token);
|
||||||
error = "Invalid token\n";
|
error = "Invalid token\n";
|
||||||
error_code = EVHTP_RES_BADREQ;
|
error_code = EVHTP_RES_BADREQ;
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1166,6 +1169,8 @@ out:
|
|||||||
json_decref (info_obj);
|
json_decref (info_obj);
|
||||||
if (filename)
|
if (filename)
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
|
if (repo_id)
|
||||||
|
g_free (repo_id);
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
evbuffer_add_printf(req->buffer_out, "%s\n", error);
|
evbuffer_add_printf(req->buffer_out, "%s\n", error);
|
||||||
|
@@ -445,7 +445,8 @@ pack_files (const char *store_id,
|
|||||||
data = pack_dir_data_new (store_id, repo_version, dirname,
|
data = pack_dir_data_new (store_id, repo_version, dirname,
|
||||||
crypt, is_windows);
|
crypt, is_windows);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
seaf_warning ("Failed to create pack dir data.\n");
|
seaf_warning ("Failed to create pack dir data for %s.\n",
|
||||||
|
strcmp (dirname, "")==0 ? "multi files" : dirname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,24 +456,25 @@ pack_files (const char *store_id,
|
|||||||
// Pack dir
|
// Pack dir
|
||||||
if (archive_dir (data, (char *)internal, "", progress) < 0) {
|
if (archive_dir (data, (char *)internal, "", progress) < 0) {
|
||||||
if (progress->canceled)
|
if (progress->canceled)
|
||||||
seaf_warning ("Zip task for dir %s canceled.\n", dirname);
|
seaf_warning ("Zip task for dir %s in repo %.8s canceled.\n", dirname, store_id);
|
||||||
else
|
else
|
||||||
seaf_warning ("Failed to archive dir %s.\n", dirname);
|
seaf_warning ("Failed to archive dir %s in repo %.8s.\n", dirname, store_id);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Pack multi
|
// Pack multi
|
||||||
if (archive_multi (data, (GList *)internal, progress) < 0) {
|
if (archive_multi (data, (GList *)internal, progress) < 0) {
|
||||||
if (progress->canceled)
|
if (progress->canceled)
|
||||||
seaf_warning ("Archiving multi files canceled.\n");
|
seaf_warning ("Archiving multi files in repo %.8s canceled.\n", store_id);
|
||||||
else
|
else
|
||||||
seaf_warning ("Failed to archive multi files.\n");
|
seaf_warning ("Failed to archive multi files in repo %.8s.\n", store_id);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (archive_write_finish(data->a) < 0) {
|
if (archive_write_finish(data->a) < 0) {
|
||||||
seaf_warning ("Failed to archive write finish.\n");
|
seaf_warning ("Failed to archive write finish for %s in repo %.8s.\n",
|
||||||
|
strcmp (dirname, "")==0 ? "multi files" : dirname, store_id);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user