@soga/baidu-ua 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +7 -1
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -39,7 +39,12 @@ class BaiduUA {
39
39
  };
40
40
  }
41
41
  }
42
+ getting = false;
42
43
  async getBest(is_large_file) {
44
+ while (this.getting) {
45
+ await new Promise((resolve) => setTimeout(resolve, 100));
46
+ }
47
+ this.getting = true;
43
48
  const list = is_large_file
44
49
  ? Object.values(this.ua_map).filter((item) => !item.is_web)
45
50
  : Object.values(this.ua_map);
@@ -70,7 +75,8 @@ class BaiduUA {
70
75
  });
71
76
  }
72
77
  item.start_time = Date.now();
73
- console.log('get best ua: ', item.ua.slice(0, 24));
78
+ console.log('get best ua : ', item.ua.slice(0, 24));
79
+ this.getting = false;
74
80
  return item;
75
81
  }
76
82
  finishUA(ua) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soga/baidu-ua",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -31,5 +31,5 @@
31
31
  "keywords": [],
32
32
  "author": "",
33
33
  "license": "ISC",
34
- "gitHead": "99f8fe90e0f34b6a645e6b2c6682071f74c9a0dc"
34
+ "gitHead": "1f22188c2926f8657c17bafeac7fa6bbcd66a599"
35
35
  }