Skip to content

Commit 6be122a

Browse files
committed
feat: support load Unload Res
1 parent 9c27174 commit 6be122a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pyWrapper.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ int PyWrapper::wrapperFini() {
249249
}
250250

251251
int PyWrapper::wrapperOnceExec(const char *usrTag, std::map <std::string, std::string> params, DataListCls reqData,
252-
pDataList *respData, std::string sid, wrapperCallback cb, unsigned int psrId ) {
252+
pDataList *respData, std::string sid, wrapperCallback cb, unsigned int psrId) {
253253
SetSidUsrTag(sid, usrTag);
254254
try {
255255
if (cb != nullptr) {
@@ -305,7 +305,7 @@ int PyWrapper::wrapperOnceExec(const char *usrTag, std::map <std::string, std::s
305305
// strdup(.c_str());
306306
tmpData->data = pr;
307307
//tmpData->status = DataStatus(itemData.status);
308-
tmpData -> status = DataOnce;
308+
tmpData->status = DataOnce;
309309
if (idx == 0) {
310310
headPtr = tmpData;
311311
curPtr = tmpData;
@@ -556,12 +556,15 @@ int PyWrapper::wrapperLoadRes(pDataList p, unsigned int resId) {
556556
}
557557
py::gil_scoped_acquire acquire;
558558
// 执行python exec 推理
559-
py::object r = _wrapperLoadRes(perData, resId);
560-
return 0;
559+
int ret = _wrapperLoadRes(perData, resId).cast<int>();;
560+
return ret;
561561
}
562562

563563
int PyWrapper::wrapperUnloadRes(unsigned int resId) {
564-
return 0;
564+
py::gil_scoped_acquire acquire;
565+
// 执行python exec 推理
566+
int ret = _wrapperUnloadRes(resId).cast<int>();;
567+
return ret;
565568
}
566569

567570
int PyWrapper::wrapperTest() {

0 commit comments

Comments
 (0)