File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,8 @@ QgsVectorLayerExporter::ExportError QgsOgrProvider::createEmptyLayer( const QStr
343
343
}
344
344
}
345
345
346
+ QgsOgrProviderUtils::invalidateCachedLastModifiedDate( uri );
347
+
346
348
return QgsVectorLayerExporter::NoError;
347
349
}
348
350
@@ -4312,6 +4314,22 @@ static QDateTime getLastModified( const QString &dsName )
4312
4314
return QFileInfo ( dsName ).lastModified ();
4313
4315
}
4314
4316
4317
+ // In case we do very fast structural changes within the same second,
4318
+ // the last modified date might not change enough, so artificially
4319
+ // decrement the cache modified date, so that the file appears newer to it
4320
+ void QgsOgrProviderUtils::invalidateCachedLastModifiedDate ( const QString &dsName )
4321
+ {
4322
+ QMutexLocker locker ( &globalMutex );
4323
+
4324
+ auto iter = mapDSNameToLastModifiedDate.find ( dsName );
4325
+ if ( iter != mapDSNameToLastModifiedDate.end () )
4326
+ {
4327
+ QgsDebugMsg ( QString ( " invalidating last modified date for %1" ).arg ( dsName ) );
4328
+ iter.value () = iter.value ().addSecs ( -10 );
4329
+ }
4330
+ }
4331
+
4332
+
4315
4333
QString QgsOgrProviderUtils::expandAuthConfig ( const QString &dsName )
4316
4334
{
4317
4335
QString uri ( dsName );
Original file line number Diff line number Diff line change @@ -418,6 +418,9 @@ class QgsOgrProviderUtils
418
418
419
419
// ! Return the string to provide to QgsOgrConnPool::instance() methods
420
420
static QString connectionPoolId ( const QString &dataSourceURI );
421
+
422
+ // ! Invalidate the cached last modified date of a dataset
423
+ static void invalidateCachedLastModifiedDate ( const QString &dsName );
421
424
};
422
425
423
426
You can’t perform that action at this time.
0 commit comments