ENH: Limit StaffPick Query

JIRA: none
Change-Id: Iee09c8e73e07af69472b373e2d3f89d4715e836f
This commit is contained in:
zorro.zhang 2024-08-30 14:28:22 +08:00 committed by Lane.Wei
parent 15f74a0a55
commit 2c2f19c5bd
1 changed files with 11 additions and 0 deletions

View File

@ -11,6 +11,7 @@
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/chrono.hpp>
#include <wx/sizer.h>
#include <wx/toolbar.h>
@ -514,6 +515,16 @@ void WebViewPanel::SendRecentList(int images)
void WebViewPanel::SendDesignStaffpick(bool on)
{
static long long StaffPickMs = 0;
auto now = std::chrono::system_clock::now();
long long TmpMs = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
long long nInterval = TmpMs - StaffPickMs;
if (nInterval < 500) return;
StaffPickMs = TmpMs;
BOOST_LOG_TRIVIAL(info) << "Begin SendDesignStaffpick: " << nInterval;
try {
if (on) {
std::string sguide = wxGetApp().app_config->get("firstguide", "finish");