Jelajahi Sumber

fix dexador old param :timeout

Vyacheslav Shebanov 5 tahun lalu
induk
melakukan
710272b56a
6 mengubah file dengan 12 tambahan dan 12 penghapusan
  1. 1 1
      plugins/forecast.lisp
  2. 1 1
      plugins/foursquare.lisp
  3. 1 1
      plugins/tumblr.lisp
  4. 1 1
      plugins/vk.lisp
  5. 2 2
      telegram.lisp
  6. 6 6
      utils.lisp

+ 1 - 1
plugins/forecast.lisp

@@ -11,7 +11,7 @@
                         "~A/~A/~A,~A~@[,~A~]?units=si&exclude=~:[currently,~;~]~:[minutely,~;~]~:[hourly,~;~]~:[daily,~;~]~:[alerts,~;~]flags&lang=ru"
                         +forecast-api-url+ *forecast-api-key* lat lon time
                         currently minutely hourly daily alerts)
-                :timeout 5))
+                :read-timeout 5))
 
 (defvar *forecast-point-formats*
   '((:current . (:year "-" (:month 2) "-" (:day 2) " " (:hour 2) ":" (:min 2)))

+ 1 - 1
plugins/foursquare.lisp

@@ -60,7 +60,7 @@
                                       (cons "oauth_token" access-token)
                                       (cons "v" "20150811")
                                       params)
-                         :timeout 5))
+                         :read-timeout 5))
          (meta (aget "meta" resp)))
     (when (not (= 200 (aget "code" meta)))
       (error (format nil "Foursquare API error, code ~A, errorType '~A', errorDetail '~A'"

+ 1 - 1
plugins/tumblr.lisp

@@ -38,7 +38,7 @@
      (subseq (http-request
               (format nil "~A/api/read/json" domain)
               :parameters params
-              :timeout *read-timeout*)
+              :read-timeout *read-timeout*)
              22)
      :object-as :alist)))
 

+ 1 - 1
plugins/vk.lisp

@@ -29,7 +29,7 @@
          (response (json-request (format nil +vk-api-url+ method +vk-api-ver+)
                                  :method :post
                                  :content params
-                                 :timeout 5)))
+                                 :read-timeout 5)))
     (when (aget "error" response)
       (error (aget "error_msg" (aget "error" response))))
     (aget "response" response)))

+ 2 - 2
telegram.lisp

@@ -57,7 +57,7 @@
                                     *telegram-token* method)
                             :method :post
                             :content params
-                            :timeout timeout)))
+                            :read-timeout timeout)))
         (unless (aget "ok" response)
           (error (aget "description" response)))
         (aget "result" response))
@@ -69,7 +69,7 @@
    "getUpdates"
    (list (cons "offset" offset)
          (cons "limit" limit)
-         (cons "timeout" timeout))))
+         (cons "read-timeout" timeout))))
 
 (defun telegram-get-me ()
   (%telegram-api-call "getMe"))

+ 6 - 6
utils.lisp

@@ -256,8 +256,8 @@ is replaced with replacement."
       (setf (quri:uri-scheme uri) "http"))
     (values uri userinfo)))
 
-(defun http-request (url &rest args &key method version parameters content headers basic-auth cookie-jar keep-alive use-connection-pool (max-redirects 5) timeout force-binary want-stream ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent)
-  (declare (ignore method version content basic-auth cookie-jar keep-alive use-connection-pool max-redirects timeout force-binary want-stream ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path))
+(defun http-request (url &rest args &key method version parameters content headers basic-auth cookie-jar keep-alive use-connection-pool (max-redirects 5) read-timeout force-binary want-stream ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent)
+  (declare (ignore method version content basic-auth cookie-jar keep-alive use-connection-pool max-redirects read-timeout force-binary want-stream ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path))
   (multiple-value-bind (uri userinfo)
       (http-default url parameters)
     (when userinfo
@@ -272,8 +272,8 @@ is replaced with replacement."
     (apply #'dex:request uri :headers headers args)))
 
 ;; XML processing
-(defun xml-request (url &rest args &key method parameters content headers basic-auth cookie-jar keep-alive use-connection-pool timeout ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent encoding)
-  (declare (ignore method parameters headers content basic-auth cookie-jar keep-alive use-connection-pool timeout ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent))
+(defun xml-request (url &rest args &key method parameters content headers basic-auth cookie-jar keep-alive use-connection-pool read-timeout ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent encoding)
+  (declare (ignore method parameters headers content basic-auth cookie-jar keep-alive use-connection-pool read-timeout ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent))
   (remf args :encoding)
   (multiple-value-bind (raw-body status headers uri)
       (apply #'http-request url :force-binary t args)
@@ -349,8 +349,8 @@ is replaced with replacement."
   (when text (trim-nil (plump:text (plump:parse text)))))
 
 ;; JSON processing
-(defun json-request (url &rest args &key method parameters content headers basic-auth cookie-jar keep-alive use-connection-pool timeout ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent (object-as :alist) json-content)
-  (declare (ignore method parameters basic-auth cookie-jar keep-alive use-connection-pool timeout ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent))
+(defun json-request (url &rest args &key method parameters content headers basic-auth cookie-jar keep-alive use-connection-pool read-timeout ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent (object-as :alist) json-content)
+  (declare (ignore method parameters basic-auth cookie-jar keep-alive use-connection-pool read-timeout ssl-key-file ssl-cert-file ssl-key-password stream verbose proxy insecure ca-path user-agent))
   (when (and (consp content) json-content)
     (setf content (with-output-to-string (s) (yason:encode-alist content s)))
     (push (cons :content-type "application/json") headers))