2017-10-17 85 views
0

雖然廣播推杆時,我收到以下錯誤:「時間戳過期」從REST API響應:如何解決的時候觸發一個事件

(1/1) BroadcastException Timestamp expired: Given timestamp (2017-10-18T00:55:07Z) not within 600s of server time (2017-10-17T12:23:17Z) in PusherBroadcaster.php (line 106) at 
    PusherBroadcaster->broadcast(array(object(PrivateChannel)), 'App\\Events\\TestEvent', array('message' => 'How are you')) in BroadcastEvent.php (line 48) at 
    BroadcastEvent->handle(object(PusherBroadcaster)) at 
    call_user_func_array(array(object(BroadcastEvent), 'handle'), array(object(PusherBroadcaster))) in BoundMethod.php (line 29) at 
    BoundMethod::Illuminate\Container\{closure}() in BoundMethod.php (line 87) at 
    BoundMethod::callBoundMethod(object(Application), array(object(BroadcastEvent), 'handle'), object(Closure)) in BoundMethod.php (line 31) at 
    BoundMethod::call(object(Application), array(object(BroadcastEvent), 'handle'), array(), null) in Container.php (line 539) at 
    Container->call(array(object(BroadcastEvent), 'handle')) in Dispatcher.php (line 94) at 
    Dispatcher->Illuminate\Bus\{closure}(object(BroadcastEvent)) in Pipeline.php (line 114) at 
    Pipeline->Illuminate\Pipeline\{closure}(object(BroadcastEvent)) in Pipeline.php (line 102) 

我使用Windows。

這是錯誤消息:Timestamp expired: Given timestamp (2017-10-18T00:55:07Z) not within 600s of server time (2017-10-17T12:23:17Z)

我已經正確配置了我的Pusher廣播並觸發了事件,但是 - 什麼也沒有。

下面是Laravel堆棧跟蹤和Pusher調試控制檯的屏幕截圖。


我怎樣才能解決這個問題?

+0

你的事件創建/推送代碼是什麼樣的? –

回答

1

看起來錯誤非常明顯,事件的時間戳(2017-10-18T00:55:07Z)比當前服務器時間(2017-10-17T12:23:17Z)還要高出600秒。所以其中之一是錯誤的。因此,檢查代碼是否正確設置時間戳,並檢查服務器時間是否正確。

+0

如何在laravel中設置時間戳..?我該如何糾正它。 – Divya

0

如果您使用的是Vagrant/Homestead,當您的計算機進入睡眠狀態時,您的系統時間可能會發生變化並失去同步。

vagrant ssh 
sudo apt install ntpdate 
sudo ntpdate ntp.ubuntu.com 
sudo timedatectl set-ntp on 
sudo service ntp stop 
sudo ntpd -gq 
sudo service ntp start 

然後

cd /path/to/homestead 
    vagrant plugin install vagrant-vbguest 
    vagrant halt 
    vagrant up 

我有同樣的問題,並糾正我的系統時間以這種方式解決了這個問題對我來說。這裏的討論是有幫助的: https://github.com/laravel/homestead/issues/799

相關問題