Skip to content

Commit

Permalink
[#1] fix : 코드 복원, wait시간 조정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimhaech committed Nov 20, 2023
1 parent e43c7e9 commit e3968c6
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions common/indi_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
async def wait_data(key, result):
count = 0
while key not in result:
await asyncio.sleep(1)
await asyncio.sleep(0.2)
count += 1
if count > 5:
if count > 15:
return 0
return result[key]

Expand Down Expand Up @@ -383,6 +383,25 @@ def TRShow_ReceiveData(self, giCtrl, rqid):
self.callback_result[rqid] = tr_data_output
except ValueError as e:
self.callback_result[rqid] = 0

# CASE 종목 정보 조회
if TR_Name == "TR_1110_11":
nCnt = giCtrl.GetMultiRowCount()
print("c")
print(nCnt)
try:
tr_data_output.append({})
tr_data_output[0]["day_range"] = str(
giCtrl.GetSingleData(3)) # 등락률
tr_data_output[0]["market_cap"] = str(
giCtrl.GetSingleData(15)) # 시가총액

if len(tr_data_output) == 0:
raise ValueError("에러 발생 로그 확인")
else:
self.callback_result[rqid] = tr_data_output
except ValueError as e:
self.callback_result[rqid] = 0

# CASE 종목 현재가 조회
if TR_Name == "SC":
Expand Down

0 comments on commit e3968c6

Please sign in to comment.