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 @@ -53,19 +53,22 @@ private void init() {
5353 synchronized (GetIpRegionMethod .class ) {
5454 try {
5555 if (null == ip2Region ) {
56- Config v4Config = null ;
56+
5757 File ipv4 = getFilePath ("ip2region_v4.xdb" );
5858 File ipv6 = getFilePath ("ip2region_v6.xdb" );
59+ Config v4Config = null ;
5960 if (ipv4 .exists ()) {
60- Config .custom ().setCachePolicy (Config .VIndexCache ).setSearchers (20 ).setXdbFile (ipv4 ).asV4 ();
61+ v4Config = Config .custom ().setCachePolicy (Config .VIndexCache ).setSearchers (20 )
62+ .setCacheSliceBytes (20 * 1024 * 1024 ).setXdbFile (ipv4 ).asV4 ();
6163 } else {
62- Config .custom ().setCachePolicy (Config .BufferCache )
63- .setXdbInputStream (GetIpRegionMethod .class .getResourceAsStream ("/ip2region_v4.xdb" )).asV4 ();
64+ v4Config = Config .custom ().setCachePolicy (Config .BufferCache )
65+ .setXdbInputStream (GetIpRegionMethod .class .getResourceAsStream ("/ip2region_v4.xdb" ))
66+ .setCacheSliceBytes (20 * 1024 * 1024 ).asV4 ();
6467 }
6568 Config v6Config = null ;
6669 if (ipv6 .exists ()) {
67- v6Config = Config .custom ().setCachePolicy (Config .VIndexCache ).setSearchers (20 ). setXdbFile ( ipv6 )
68- .asV6 ();
70+ v6Config = Config .custom ().setCachePolicy (Config .VIndexCache ).setSearchers (20 )
71+ .setCacheSliceBytes ( 50 * 1024 * 1024 ). setXdbFile ( ipv6 ). asV6 ();
6972 }
7073 ip2Region = Ip2Region .create (v4Config , v6Config );
7174 }
You can’t perform that action at this time.
0 commit comments