@@ -60,39 +60,15 @@ public function notifyException($exception)
60
60
61
61
$ date = date ('Y-m-d H:i:s ' );
62
62
63
- // Check for existing record
64
- $ existingError = \DB ::connection ('exceptions ' )->table ('site_exceptions ' )->where ('name ' , $ this ->name )->where ('message ' , $ this ->message )->where ('siteKeyName ' , $ this ->site )->first ();
65
-
66
- if (count ($ existingError ) == 0 ) {
67
- \DB ::connection ('exceptions ' )->table ('site_exceptions ' )->insert (array (
68
- 'name ' => $ this ->name ,
69
- 'message ' => $ this ->message ,
70
- 'file ' => $ this ->file ,
71
- 'line ' => $ this ->line ,
72
- 'siteKeyName ' => $ this ->site ,
73
- 'userIp ' => $ this ->userIp ,
74
- 'fatal ' => $ this ->fatal ,
75
- 'userId ' => $ this ->userId ,
76
- 'username ' => $ this ->username ,
77
- 'count ' => 1 ,
78
- 'created_at ' => $ date ,
79
- 'updated_at ' => null
80
- ));
81
- } elseif ($ existingError ->created_at != $ date && $ existingError ->updated_at != $ date ) {
82
- \DB ::connection ('exceptions ' )->table ('site_exceptions ' )->insert (array (
83
- 'name ' => $ this ->name ,
84
- 'message ' => $ this ->message ,
85
- 'file ' => $ this ->file ,
86
- 'line ' => $ this ->line ,
87
- 'siteKeyName ' => $ this ->site ,
88
- 'userIp ' => $ this ->userIp ,
89
- 'fatal ' => $ this ->fatal ,
90
- 'userId ' => $ this ->userId ,
91
- 'username ' => $ this ->username ,
92
- 'count ' => 1 ,
93
- 'created_at ' => $ date ,
94
- 'updated_at ' => null
95
- ));
96
- }
63
+ $ object = $ this ;
64
+
65
+ // Send the error to core
66
+ \Queue::push (function ($ job ) use ($ object ) {
67
+ $ response = \cURL::newRequest ('post ' , 'http://control.stygianvault.com/siteExceptions/ ' . $ object ->site , ['post ' => (array )$ object ])
68
+ ->setHeader ('User-Agent ' , 'Control ' )
69
+ ->send ();
70
+
71
+ $ job ->delete ();
72
+ });
97
73
}
98
74
}
0 commit comments