Commit 63cba94c authored by Toon Claes's avatar Toon Claes

Memoize migration files per migrations paths

Because the Geo tracking database uses different migration paths,
memoize the migration files per set of `paths`.

Closes gitlab-org/gitlab-ee#3701.
parent bd7ba308
......@@ -10,7 +10,8 @@ if Rails.env.test?
# it reads + parses `db/migrate/*` each time. Memoizing it can save 0.5
# seconds per spec.
def migrations(paths)
(@migrations ||= migrations_unmemoized(paths)).dup
@migrations ||= {}
(@migrations[paths] ||= migrations_unmemoized(paths)).dup
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment