File tree 1 file changed +3
-17
lines changed
Sources/UnidocDB/Packages
1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -111,12 +111,10 @@ extension PackageDatabase.Editions
111
111
version: SemanticVersion ,
112
112
with session: Mongo . Session ) async throws -> Int32 ?
113
113
{
114
- // We use the SHA-1 hash as “proof” that the edition has at least one symbol graph.
115
- // Therefore, merely registering tags does not update hashes.
116
114
let placement : Placement = try await self . register ( package : package ,
117
115
version: version,
118
116
refname: tag. name,
119
- sha1: nil ,
117
+ sha1: tag . hash ,
120
118
with: session)
121
119
122
120
return placement. new ? placement. coordinate : nil
@@ -152,24 +150,12 @@ extension PackageDatabase.Editions
152
150
{
153
151
switch placement. sha1
154
152
{
155
- case nil :
156
- // If the edition would gain a hash, we should update it.
157
-
158
- // FIXME: this can race another update, in which case we will store an
159
- // arbitrary choice of hash without marking the edition dirty.
160
- // We should use `placement.sha1` as a hint to skip the update only,
161
- // and set the dirty flag within a custom update statement.
162
- try await self . update ( some: edition, with: session)
163
-
164
153
case sha1? :
165
154
// Nothing to do.
166
155
break
167
156
168
- case _? :
169
- try await self . update ( field: PackageEdition [ . lost] ,
170
- of: edition. id,
171
- to: true ,
172
- with: session)
157
+ case _:
158
+ try await self . update ( some: edition, with: session)
173
159
}
174
160
}
175
161
You can’t perform that action at this time.
0 commit comments