超时问题

This commit is contained in:
邓皓元 2019-01-23 19:05:12 +08:00
parent 2647a4547e
commit 432dc7b3e7
3 changed files with 16 additions and 0 deletions

View File

@ -38,6 +38,9 @@ class MongoSyncJob implements ShouldQueue
$this->page = $page; $this->page = $page;
$this->limit = $limit; $this->limit = $limit;
$this->utcDateTime = $utcDateTime; $this->utcDateTime = $utcDateTime;
set_time_limit(0);
ini_set('memory_limit', '4096m');
ini_set('default_socket_timeout', -1);
} }
/** /**
@ -98,5 +101,7 @@ class MongoSyncJob implements ShouldQueue
$builder->connection->insert($sql, Arr::flatten($values, 1)); $builder->connection->insert($sql, Arr::flatten($values, 1));
app(CardRepository::class)->forgetCached(); app(CardRepository::class)->forgetCached();
Log::info("MongoSyncJob END #: utcDateTime {$this->utcDateTime} - page {$this->page}");
} }
} }

View File

@ -40,6 +40,9 @@ class CardSyncJob implements ShouldQueue
$this->page = $page; $this->page = $page;
$this->limit = $limit; $this->limit = $limit;
$this->maxId = $maxId; $this->maxId = $maxId;
set_time_limit(0);
ini_set('memory_limit', '4096m');
ini_set('default_socket_timeout', -1);
} }
/** /**
@ -101,5 +104,7 @@ class CardSyncJob implements ShouldQueue
$builder->connection->insert($sql, Arr::flatten($array, 1)); $builder->connection->insert($sql, Arr::flatten($array, 1));
app(CardRepository::class)->forgetCached(); app(CardRepository::class)->forgetCached();
Log::info("CardSyncJob END #: maxId {$this->maxId} - page {$this->page}");
} }
} }

View File

@ -64,6 +64,9 @@ class LogSyncJob implements ShouldQueue
$this->page = $page; $this->page = $page;
$this->limit = $limit; $this->limit = $limit;
$this->maxId = $maxId; $this->maxId = $maxId;
set_time_limit(0);
ini_set('memory_limit', '4096m');
ini_set('default_socket_timeout', -1);
} }
/** /**
@ -175,6 +178,7 @@ class LogSyncJob implements ShouldQueue
} catch (\Exception $e) { } catch (\Exception $e) {
DB::rollback(); DB::rollback();
Log::info("LogSyncJob ERROR #: maxId {$this->maxId} - page {$this->page}");
throw $e; throw $e;
} }
@ -186,6 +190,8 @@ class LogSyncJob implements ShouldQueue
app(OrderRenewalPackageCardRepository::class)->forgetCached(); app(OrderRenewalPackageCardRepository::class)->forgetCached();
app(OrderFlowPackageCardsRepository::class)->forgetCached(); app(OrderFlowPackageCardsRepository::class)->forgetCached();
app(OrderCardPartitionRepository::class)->forgetCached(); app(OrderCardPartitionRepository::class)->forgetCached();
Log::info("LogSyncJob END #: maxId {$this->maxId} - page {$this->page}");
} }
/** /**