Pārlūkot izejas kodu

reduce download spam in log

David Rose 16 gadi atpakaļ
vecāks
revīzija
b86a9f0d8d
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3 3
      direct/src/plugin/p3dDownload.cxx

+ 3 - 3
direct/src/plugin/p3dDownload.cxx

@@ -165,11 +165,11 @@ receive_data(const unsigned char *this_data, size_t this_data_size) {
 void P3DDownload::
 download_progress() {
   time_t now = time(NULL);
-  if (now != _last_reported_time || true) {
+  if (now - _last_reported_time > 10) {
     _last_reported_time = now;
+    nout << "Downloading " << get_url() << ": " 
+         << int(get_download_progress() * 1000.0) / 10.0 << "\n";
   }
-  nout << "Downloading " << get_url() << ": " 
-       << int(get_download_progress() * 1000.0) / 10.0 << "\n";
 }
 
 ////////////////////////////////////////////////////////////////////