You are viewing a plain text version of this content. The canonical link for it is here.
Posted to geb-notifications@groovy.apache.org by jo...@apache.org on 2025/09/26 04:28:34 UTC

(groovy-geb) branch bugfix/288-driver-cache created (now 6866f20e)

This is an automated email from the ASF dual-hosted git repository.

jonnybot pushed a change to branch bugfix/288-driver-cache
in repository https://gitbox.apache.org/repos/asf/groovy-geb.git


      at 6866f20e Return global or per thread cache from clearCache method

This branch includes the following new commits:

     new 6866f20e Return global or per thread cache from clearCache method

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(groovy-geb) 01/01: Return global or per thread cache from clearCache method

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jonnybot pushed a commit to branch bugfix/288-driver-cache
in repository https://gitbox.apache.org/repos/asf/groovy-geb.git

commit 6866f20ed27a2f3a567dbbe194e16c4cbdde0e7f
Author: Jonny Carter <jc...@adaptavist.com>
AuthorDate: Thu Sep 25 23:13:43 2025 -0500

    Return global or per thread cache from clearCache method
---
 .../geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/module/geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy b/module/geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy
index f4550123..44df6bdb 100644
--- a/module/geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy
+++ b/module/geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy
@@ -44,8 +44,9 @@ class CachingDriverFactory implements DriverFactory {
     }
 
     static WebDriver clearCache() {
-        GLOBAL_CACHE.get { null }?.clear()
-        PER_THREAD_CACHE.get { null }?.clear()
+        def globalDriver = GLOBAL_CACHE.get { null }?.clear()
+        def perThreadDriver = PER_THREAD_CACHE.get { null }?.clear()
+        return globalDriver ?: perThreadDriver
     }
 
     static WebDriver clearCacheAndQuitDriver() {