commit | 85aecd53f47f1fb1132f26ec04638d788e0708a1 | [log] [tgz] |
---|---|---|
author | Danny Tuppeny <danny@tuppeny.com> | Thu Feb 25 18:02:36 2021 +0000 |
committer | commit-bot@chromium.org <commit-bot@chromium.org> | Thu Feb 25 18:02:36 2021 +0000 |
tree | 9c4517931c92f88480cf7ebfaf82617638d8cc07 | |
parent | 137de39b7a72837a7851eb51389fd5811239f5a3 [diff] |
[analyzer] Seed overlay modification stamp with DateTime.now().millisecondsSinceEpoch Fixes https://github.com/Dart-Code/Dart-Code/issues/3160. Change-Id: If57d37796dc36c06ec4bbd986719cecbbc1a98a9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187462 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analysis_server/lib/src/analysis_server_abstract.dart b/pkg/analysis_server/lib/src/analysis_server_abstract.dart index 5589872..f7d620e 100644 --- a/pkg/analysis_server/lib/src/analysis_server_abstract.dart +++ b/pkg/analysis_server/lib/src/analysis_server_abstract.dart
@@ -112,7 +112,12 @@ final OverlayResourceProvider resourceProvider; /// The next modification stamp for a changed file in the [resourceProvider]. - int overlayModificationStamp = 0; + /// + /// This value is increased each time it is used and used instead of real + /// modification stamps. It's seeded with `millisecondsSinceEpoch` to reduce + /// the chance of colliding with values used in previous analysis sessions if + /// used as a cache key. + int overlayModificationStamp = DateTime.now().millisecondsSinceEpoch; AbstractAnalysisServer( this.options,