Skip to content

Commit

Permalink
fixed compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Sep 18, 2018
1 parent 40ad7f9 commit 7f26a37
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/main/java/com/alibaba/druid/pool/DruidDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -1706,13 +1706,22 @@ protected void recycle(DruidPooledConnection pooledConnection) throws SQLExcepti
}

boolean result;
final long lastActiveTimeMillis = System.currentTimeMillis();
final long currentTimeMillis = System.currentTimeMillis();

if (phyTimeoutMillis > 0) {
long phyConnectTimeMillis = currentTimeMillis - holder.connectTimeMillis;
if (phyConnectTimeMillis > phyTimeoutMillis) {
discardConnection(holder.conn);
return;
}
}

lock.lock();
try {
activeCount--;
closeCount++;

result = putLast(holder, lastActiveTimeMillis);
result = putLast(holder, currentTimeMillis);
recycleCount++;
} finally {
lock.unlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.druid.sql.visitor
package com.alibaba.druid.sql.visitor;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
Expand Down

0 comments on commit 7f26a37

Please sign in to comment.