mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
ENH: advance hms file get strategy
Jira: [STUDIO-13356] Change-Id: I2192defc17730ddedd2f667a62b0654ca6f13721 (cherry picked from commit aef88d650495740cac6a45a411e7f9a076c6cab9)
This commit is contained in:
@@ -608,7 +608,14 @@ void HMSQuery::init_hms_info(const std::string& dev_type_id)
|
|||||||
|
|
||||||
/*download from cloud*/
|
/*download from cloud*/
|
||||||
time_t info_last_update_time = m_cloud_hms_last_update_time[dev_type_id];
|
time_t info_last_update_time = m_cloud_hms_last_update_time[dev_type_id];
|
||||||
if (time(nullptr) - info_last_update_time > (60 * 60 * 24))/*do not update in one day to reduce waiting*/
|
|
||||||
|
/* check hms is valid or not */
|
||||||
|
bool retry = false;
|
||||||
|
if(m_hms_info_jsons[dev_type_id].empty() || m_hms_action_jsons[dev_type_id].empty()){
|
||||||
|
retry =time(nullptr) - info_last_update_time > (60 * 1); // retry after 1 minute
|
||||||
|
}
|
||||||
|
|
||||||
|
if (time(nullptr) - info_last_update_time > (60 * 60 * 24) || retry)/*do not update in one day to reduce waiting*/
|
||||||
{
|
{
|
||||||
download_hms_related(QUERY_HMS_INFO, dev_type_id, &m_hms_info_jsons[dev_type_id]);
|
download_hms_related(QUERY_HMS_INFO, dev_type_id, &m_hms_info_jsons[dev_type_id]);
|
||||||
download_hms_related(QUERY_HMS_ACTION, dev_type_id, &m_hms_action_jsons[dev_type_id]);
|
download_hms_related(QUERY_HMS_ACTION, dev_type_id, &m_hms_action_jsons[dev_type_id]);
|
||||||
|
|||||||
Reference in New Issue
Block a user