fix: Fix the defect that the knowledge base vectorization time is inconsistent with the system
--bug=1052060 --user=王孝刚 【知识库】-同步Web站点知识库,同步状态的时间与当前时区不一致,晚8小时 https://www.tapd.cn/57709429/s/1651754
This commit is contained in:
parent
bf12d2bfd3
commit
2c03b2859d
@ -9,6 +9,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
|
import datetime
|
||||||
import traceback
|
import traceback
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
@ -229,9 +230,11 @@ class ListenerManagement:
|
|||||||
next_index = taskType.value + 1
|
next_index = taskType.value + 1
|
||||||
current_index = taskType.value
|
current_index = taskType.value
|
||||||
status_number = state.value
|
status_number = state.value
|
||||||
|
current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f') + '+00'
|
||||||
params_dict = {'${bit_number}': bit_number, '${up_index}': up_index,
|
params_dict = {'${bit_number}': bit_number, '${up_index}': up_index,
|
||||||
'${status_number}': status_number, '${next_index}': next_index,
|
'${status_number}': status_number, '${next_index}': next_index,
|
||||||
'${table_name}': query_set.model._meta.db_table, '${current_index}': current_index}
|
'${table_name}': query_set.model._meta.db_table, '${current_index}': current_index,
|
||||||
|
'${current_time}': current_time}
|
||||||
for key in params_dict:
|
for key in params_dict:
|
||||||
_value_ = params_dict[key]
|
_value_ = params_dict[key]
|
||||||
exec_sql = exec_sql.replace(key, str(_value_))
|
exec_sql = exec_sql.replace(key, str(_value_))
|
||||||
|
|||||||
@ -6,8 +6,8 @@ status_meta = jsonb_set (
|
|||||||
"${table_name}".status_meta,
|
"${table_name}".status_meta,
|
||||||
'{state_time,${current_index}}',
|
'{state_time,${current_index}}',
|
||||||
jsonb_set (
|
jsonb_set (
|
||||||
COALESCE ( "${table_name}".status_meta #> '{state_time,${current_index}}', jsonb_build_object ( '${status_number}', now( ) ) ),
|
COALESCE ( "${table_name}".status_meta #> '{state_time,${current_index}}', jsonb_build_object ( '${status_number}', '${current_time}' ) ),
|
||||||
'{${status_number}}',
|
'{${status_number}}',
|
||||||
CONCAT ( '"', now( ), '"' ) :: JSONB
|
CONCAT ( '"', '${current_time}', '"' ) :: JSONB
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
Loading…
Reference in New Issue
Block a user