| 2792 | } |
| 2793 | |
| 2794 | void throttle() { |
| 2795 | if (g_pserver->m_pstorageFactory && (getMaxmemoryState(NULL,NULL,NULL,NULL) != C_OK)) { |
| 2796 | while ((cstorageWritesInFlight.load(std::memory_order_relaxed) || queueJobs.size_approx()) && (getMaxmemoryState(NULL,NULL,NULL,NULL) != C_OK)) { |
| 2797 | usleep(1); |
| 2798 | pauseExecution(); |
| 2799 | ProcessWhileBlocked(); |
| 2800 | resumeExecution(); |
| 2801 | } |
| 2802 | |
| 2803 | if ((getMaxmemoryState(NULL,NULL,NULL,NULL) != C_OK)) { |
| 2804 | for (int idb = 0; idb < cserver.dbnum; ++idb) { |
| 2805 | redisDb *db = g_pserver->db[idb]; |
| 2806 | if (db->size() > 0 && db->keycacheIsEnabled()) { |
| 2807 | serverLog(LL_WARNING, "Key cache %d exceeds maxmemory during load, freeing - performance may be affected increase maxmemory if possible", idb); |
| 2808 | db->disableKeyCache(); |
| 2809 | } |
| 2810 | } |
| 2811 | } |
| 2812 | } |
| 2813 | } |
| 2814 | |
| 2815 | void enqueue(std::unique_ptr<rdbInsertJob> &spjob) { |
| 2816 | if (!fLaunched) { |
nothing calls this directly
no test coverage detected