File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3583,13 +3583,24 @@ gint64
35833583seaf_get_total_storage (GError * * error )
35843584{
35853585 gint64 size = 0 ;
3586- int ret = seaf_db_statement_foreach_row (seaf -> db ,
3586+ int ret ;
3587+ if (seaf_db_type (seaf -> db ) == SEAF_DB_TYPE_PGSQL ) {
3588+ ret = seaf_db_statement_foreach_row (seaf -> db ,
3589+ "SELECT \"size\" FROM RepoSize s "
3590+ "LEFT JOIN VirtualRepo v "
3591+ "ON s.repo_id=v.repo_id "
3592+ "WHERE v.repo_id IS NULL" ,
3593+ get_total_storage_cb ,
3594+ & size , 0 );
3595+ } else {
3596+ ret = seaf_db_statement_foreach_row (seaf -> db ,
35873597 "SELECT size FROM RepoSize s "
35883598 "LEFT JOIN VirtualRepo v "
35893599 "ON s.repo_id=v.repo_id "
35903600 "WHERE v.repo_id IS NULL" ,
35913601 get_total_storage_cb ,
35923602 & size , 0 );
3603+ }
35933604 if (ret < 0 ) {
35943605 seaf_warning ("Failed to get total storage occupation.\n" );
35953606 g_set_error (error , SEAFILE_DOMAIN , SEAF_ERR_GENERAL ,
You can’t perform that action at this time.
0 commit comments