mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-29 03:15:58 -04:00
Extend request timeout if migration needs to be done (#2241)
This commit is contained in:
@@ -41,9 +41,13 @@ class Login extends CI_Controller
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// trigger any required upgrade before starting the application
|
||||
$this->load->library('migration');
|
||||
$this->migration->latest();
|
||||
if (!$this->migration->is_latest())
|
||||
{
|
||||
set_time_limit(1200);
|
||||
// trigger any required upgrade before starting the application
|
||||
$this->migration->latest();
|
||||
}
|
||||
|
||||
if(!$this->Employee->login($username, $password))
|
||||
{
|
||||
|
||||
18
application/libraries/MY_Migration.php
Normal file
18
application/libraries/MY_Migration.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class MY_Migration extends CI_Migration {
|
||||
|
||||
public function is_latest()
|
||||
{
|
||||
$migrations = $this->find_migrations();
|
||||
$last_migration = basename(end($migrations));
|
||||
|
||||
$last_version = $this->_get_migration_number($last_migration);
|
||||
$current_version = $this->_get_version();
|
||||
|
||||
return $last_version == $current_version;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user