@@ -182,21 +182,21 @@ public Object callSingle(String fileName) throws Exception {
182
182
public Object callSingle (String fileName , Value arg ) throws Exception {
183
183
ScenarioEngine engine = getEngine ();
184
184
final Map <String , Object > CACHE = engine .runtime .featureRuntime .suite .callSingleCache ;
185
- if (CACHE .containsKey (fileName )) {
185
+ int minutes = engine .getConfig ().getCallSingleCacheMinutes ();
186
+ if ((minutes == 0 ) && CACHE .containsKey (fileName )) {
186
187
engine .logger .trace ("callSingle cache hit: {}" , fileName );
187
188
return callSingleResult (engine , CACHE .get (fileName ));
188
189
}
189
190
long startTime = System .currentTimeMillis ();
190
191
engine .logger .trace ("callSingle waiting for lock: {}" , fileName );
191
192
synchronized (CACHE ) { // lock
192
- if (CACHE .containsKey (fileName )) { // retry
193
+ if (( minutes == 0 ) && CACHE .containsKey (fileName )) { // retry
193
194
long endTime = System .currentTimeMillis () - startTime ;
194
195
engine .logger .warn ("this thread waited {} milliseconds for callSingle lock: {}" , endTime , fileName );
195
196
return callSingleResult (engine , CACHE .get (fileName ));
196
197
}
197
198
// this thread is the 'winner'
198
199
engine .logger .info (">> lock acquired, begin callSingle: {}" , fileName );
199
- int minutes = engine .getConfig ().getCallSingleCacheMinutes ();
200
200
Object result = null ;
201
201
File cacheFile = null ;
202
202
if (minutes > 0 ) {
0 commit comments