@@ -89,8 +89,8 @@ BOOL XEngine_Task_Manage(LPCTSTR lpszAPIName, LPCTSTR lpszClientAddr, LPCTSTR lp
8989 TCHAR tszFilePath[1024 ];
9090 memset (tszFilePath, ' \0 ' , sizeof (tszFilePath));
9191
92- _stprintf (tszFilePath, _T (" %s/%s" ), ppSt_DBFile [i]->st_ProtocolFile .tszFilePath , ppSt_DBFile [i]->st_ProtocolFile .tszFileName );
93- XStorageSQL_File_FileDelete (NULL , ppSt_DBFile [i]->st_ProtocolFile .tszFileHash );
92+ _stprintf (tszFilePath, _T (" %s/%s" ), ppSt_DBQuery [i]->st_ProtocolFile .tszFilePath , ppSt_DBQuery [i]->st_ProtocolFile .tszFileName );
93+ XStorageSQL_File_FileDelete (NULL , ppSt_DBQuery [i]->st_ProtocolFile .tszFileHash );
9494 }
9595 }
9696 else
@@ -102,20 +102,60 @@ BOOL XEngine_Task_Manage(LPCTSTR lpszAPIName, LPCTSTR lpszClientAddr, LPCTSTR lp
102102 TCHAR tszFilePath[1024 ];
103103 memset (tszFilePath, ' \0 ' , sizeof (tszFilePath));
104104
105- _stprintf (tszFilePath, _T (" %s/%s" ), ppSt_DBFile [i]->st_ProtocolFile .tszFilePath , ppSt_DBFile [i]->st_ProtocolFile .tszFileName );
106- XStorage_SQLite_FileDelete (NULL , ppSt_DBFile [i]->st_ProtocolFile .tszFileHash );
105+ _stprintf (tszFilePath, _T (" %s/%s" ), ppSt_DBQuery [i]->st_ProtocolFile .tszFilePath , ppSt_DBQuery [i]->st_ProtocolFile .tszFileName );
106+ XStorage_SQLite_FileDelete (NULL , ppSt_DBQuery [i]->st_ProtocolFile .tszFileHash );
107107 }
108108 }
109+ XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T (" 业务客户端:%s,请求删除文件HASH成功,文件名:%s" ), lpszClientAddr, ppSt_DBFile[i]->st_ProtocolFile .tszFileHash );
109110 }
110111 else
111112 {
112-
113+ XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T ( " 业务客户端:%s,请求删除文件失败,因为没有启用数据库,删除的HASH:%s " ), lpszClientAddr, ppSt_DBFile[i]-> st_ProtocolFile . tszFileHash );
113114 }
114115 }
115116 else
116117 {
118+ if (0 != st_ServiceCfg.st_XSql .nSQLType )
119+ {
120+ int nQueryCount = 0 ;
121+ TCHAR tszFileDir[1024 ];
122+ XSTORAGECORE_DBFILE** ppSt_DBQuery;
123+
124+ memset (tszFileDir, ' \0 ' , sizeof (tszFileDir));
125+ _stprintf (tszFileDir, _T (" %s/%s" ), ppSt_DBFile[i]->st_ProtocolFile .tszFilePath , ppSt_DBFile[i]->st_ProtocolFile .tszFileName );
126+ if (1 == st_ServiceCfg.st_XSql .nSQLType )
127+ {
128+ XStorageSQL_File_FileQuery (&ppSt_DBQuery, &nQueryCount, NULL , NULL , tszFileDir);
129+ // 删除数据库与文件
130+ for (int i = 0 ; i < nQueryCount; i++)
131+ {
132+ TCHAR tszFilePath[1024 ];
133+ memset (tszFilePath, ' \0 ' , sizeof (tszFilePath));
134+
135+ _stprintf (tszFilePath, _T (" %s/%s" ), ppSt_DBQuery[i]->st_ProtocolFile .tszFilePath , ppSt_DBQuery[i]->st_ProtocolFile .tszFileName );
136+ XStorageSQL_File_FileDelete (NULL , ppSt_DBQuery[i]->st_ProtocolFile .tszFileHash );
137+ }
138+ }
139+ else
140+ {
141+ XStorage_SQLite_FileQuery (&ppSt_DBQuery, &nQueryCount, NULL , NULL , tszFileDir);
142+ // 删除数据库与文件
143+ for (int i = 0 ; i < nQueryCount; i++)
144+ {
145+ TCHAR tszFilePath[1024 ];
146+ memset (tszFilePath, ' \0 ' , sizeof (tszFilePath));
147+
148+ _stprintf (tszFilePath, _T (" %s/%s" ), ppSt_DBQuery[i]->st_ProtocolFile .tszFilePath , ppSt_DBQuery[i]->st_ProtocolFile .tszFileName );
149+ XStorage_SQLite_FileDelete (NULL , ppSt_DBQuery[i]->st_ProtocolFile .tszFileHash );
150+ }
151+ }
152+ XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T (" 业务客户端:%s,请求删除文件名称成功,文件名:%s/%s" ), lpszClientAddr, ppSt_DBFile[i]->st_ProtocolFile .tszFilePath , ppSt_DBFile[i]->st_ProtocolFile .tszFileName );
153+ }
154+ else
155+ {
156+ XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T (" 业务客户端:%s,请求删除文件名称失败,因为没有启用数据库,删除的HASH:%s" ), lpszClientAddr, ppSt_DBFile[i]->st_ProtocolFile .tszFilePath , ppSt_DBFile[i]->st_ProtocolFile .tszFileName );
157+ }
117158 }
118- XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T (" 业务客户端:%s,请求删除文件成功,文件名:%s/%s" ), lpszClientAddr, ppSt_DBFile[i]->st_ProtocolFile .tszFilePath , ppSt_DBFile[i]->st_ProtocolFile .tszFileName );
119159 }
120160 st_HDRParam.bIsClose = TRUE ;
121161 st_HDRParam.nHttpCode = 200 ;
0 commit comments