diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index 2227e0b9..99d0ff47 100755 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -728,7 +728,17 @@ sub has_met_upgrade_prereqs { sub has_no_pending_build { my ($self) = @_; if ($self->is_upgrading) { - confess [1010, "You must complete the pending build first."]; + # sometimes the upgrade gets stuck, and someone has to jiggle + # the database. Detect the situation and jiggle the database + # immediately. + if ($self->upgrade_ends < DateTime->now) + { + $self->finish_upgrade(); + } + else + { + confess [1010, "You must complete the pending build first."]; + } } return 1; } diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 099ec264..34b681b2 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -6,6 +6,7 @@ - Mod: Sweepers adjusted for balance. - Fix: Most buildings should no longer ignore uni level. - Add: Overheating Parliament does damage. + - Fix: Buildings should no longer get stuck in upgrading state. 3.0908: - Mod: trash_messages_where now defaults to not returning deleted message IDs.