Bugzilla – Attachment 153007 Details for
Bug 27880
Store each database migrations state in database
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27880: Minor optimizations for Koha::Migrations::pending_migrations
Bug-27880-Minor-optimizations-for-KohaMigrationspe.patch (text/plain), 1.25 KB, created by
Julian Maurice
on 2023-07-04 07:47:31 UTC
(
hide
)
Description:
Bug 27880: Minor optimizations for Koha::Migrations::pending_migrations
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2023-07-04 07:47:31 UTC
Size:
1.25 KB
patch
obsolete
>From 10b3fc95b768e6d0562bba076ebaee9a19364d52 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 4 Jul 2023 09:45:26 +0200 >Subject: [PATCH] Bug 27880: Minor optimizations for > Koha::Migrations::pending_migrations > >Can save a few milliseconds when there are a lot (> 1000) of migration >files >--- > Koha/Migrations.pm | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/Koha/Migrations.pm b/Koha/Migrations.pm >index a4a6782d52..69ef70854b 100644 >--- a/Koha/Migrations.pm >+++ b/Koha/Migrations.pm >@@ -12,17 +12,19 @@ sub pending_migrations { > my @pending_migrations; > my $executed_migrations = {}; > eval { >- $executed_migrations = $dbh->selectall_hashref('SELECT * FROM executed_migrations', 'name'); >+ $executed_migrations = $dbh->selectall_hashref('SELECT name FROM executed_migrations', 'name'); > }; > > opendir(my $dh, $self->migrations_dir); >- foreach my $file (sort readdir $dh) { >+ foreach my $file (readdir $dh) { > next if $file !~ /\.pl$/; > next if (exists ($executed_migrations->{$file})); > push @pending_migrations, $file; > } > closedir($dh); > >+ @pending_migrations = sort @pending_migrations; >+ > return @pending_migrations; > } > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27880
:
117835
|
127998
|
153006
| 153007