MCPcopy Create free account
hub / github.com/Tencent/phxsql / Refill

Method Refill

phxsqlproxy/plugin/requestfilter/freqctrlconfig.cpp:60–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void FreqCtrlBucket::Refill() {
61 uint32_t last_refill_time = (unsigned int) time(NULL);
62 last_refill_time = last_refill_time - last_refill_time % (db_token_.period);
63
64 db_bucket_struct_.last_refill_time = last_refill_time;
65 db_bucket_struct_.read_bucket = db_token_.read_token;
66 db_bucket_struct_.write_bucket = db_token_.write_token;
67}
68
69void FreqCtrlBucket::Sedb_token(const DBToken_t & db_token) {
70 memcpy(&db_token_, &db_token, sizeof(db_token));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected