From d3d0cda81f2042f9094f9cb898defaa4523302a9 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Wed, 29 May 2024 19:01:23 -0700 Subject: [PATCH] Oops, fix symlink for `/public-data/latest.sql.gz` Oh whoops, I was symlinking to the *full* path of the latest dump, which includes the site version directory in it. This meant that, if 5 new versions of the app were deployed since the most recently public data commit (and so that version is deleted), the symlink fails. In this change, we just symlink to the filename, which behaves as a relative path and should be completely resilient to deploys changing where these files ostensibly live!! --- lib/tasks/public_data.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/public_data.rake b/lib/tasks/public_data.rake index 4737a3d0..7079c58e 100644 --- a/lib/tasks/public_data.rake +++ b/lib/tasks/public_data.rake @@ -57,7 +57,7 @@ namespace :public_data do # Link this latest dump as `latest.sql.gz`. latest_path = Rails.configuration.public_data_root / "latest.sql.gz" File.unlink(latest_path) if File.symlink?(latest_path) - File.symlink(dest_path, latest_path) + File.symlink(filename, latest_path) puts "Linked dump to #{latest_path}" end