Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/pkgsite: split postgres.UpsertModuleVersionState into InsertModuleVersionState and UpdateModuleVersionState #39628
At the moment, postgres.UpsertModuleVersionState is overloaded: it is used both to insert new versions from the index, and update versions after a fetch. Refactor the following:
This would result in some duplicate processing, because if we fetch a version that is not in the index through the proxy, it will subsequently be added to the index. However, this would be easier to reason about: the module_version_state table should have a 1:1 correspondence with index.golang.org, and timestamps should all be correct.