File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
publiccms-parent/publiccms-analyzer/src/main/java/com/publiccms/views/method/tools Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -52,19 +52,22 @@ private void init() {
5252 synchronized (GetIpRegionMethod .class ) {
5353 try {
5454 if (null == ip2Region ) {
55- Config v4Config = null ;
55+
5656 File ipv4 = getFilePath ("ip2region_v4.xdb" );
5757 File ipv6 = getFilePath ("ip2region_v6.xdb" );
58+ Config v4Config = null ;
5859 if (ipv4 .exists ()) {
59- Config .custom ().setCachePolicy (Config .VIndexCache ).setSearchers (20 ).setXdbFile (ipv4 ).asV4 ();
60+ v4Config = Config .custom ().setCachePolicy (Config .VIndexCache ).setSearchers (20 )
61+ .setCacheSliceBytes (20 * 1024 * 1024 ).setXdbFile (ipv4 ).asV4 ();
6062 } else {
61- Config .custom ().setCachePolicy (Config .BufferCache )
62- .setXdbInputStream (GetIpRegionMethod .class .getResourceAsStream ("/ip2region_v4.xdb" )).asV4 ();
63+ v4Config = Config .custom ().setCachePolicy (Config .BufferCache )
64+ .setXdbInputStream (GetIpRegionMethod .class .getResourceAsStream ("/ip2region_v4.xdb" ))
65+ .setCacheSliceBytes (20 * 1024 * 1024 ).asV4 ();
6366 }
6467 Config v6Config = null ;
6568 if (ipv6 .exists ()) {
66- v6Config = Config .custom ().setCachePolicy (Config .VIndexCache ).setSearchers (20 ). setXdbFile ( ipv6 )
67- .asV6 ();
69+ v6Config = Config .custom ().setCachePolicy (Config .VIndexCache ).setSearchers (20 )
70+ .setCacheSliceBytes ( 50 * 1024 * 1024 ). setXdbFile ( ipv6 ). asV6 ();
6871 }
6972 ip2Region = Ip2Region .create (v4Config , v6Config );
7073 }
You can’t perform that action at this time.
0 commit comments