title: Firebase Cloud Functions Change Timeout
body: <p>I'm using Firebase Cloud Functions library on Android, and using <code>getHttpsCallable</code> to call a cloud function. </p>
  
  <p>The problem is that the function needs 10-15 seconds to return the result back to the client, so the client throws an exception <code>java.net.SocketTimeoutException: timeout</code>. </p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>    // Create the arguments to the callable function.
      Map&lt;String, Object&gt; data = new HashMap&lt;&gt;();
      data.put("info", info);
      mFunctions.getHttpsCallable(function)
              .call(data)
              .continueWith(new Continuation&lt;HttpsCallableResult, String&gt;() {
                  @Override
                  public String then(@NonNull Task&lt;HttpsCallableResult&gt; task) {
                      // This continuation runs on either success or failure, but if the task
                      // has failed then getResult() will throw an Exception which will be
                      // propagated down.
                      if (task.isSuccessful()) {
                          String result = (String) task.getResult().getData();
                          Log.v(Constants.LOG_TAG, result);
                          return result;
                      } else {
                          // The condition never was true, always logs the exception.
                          Exception e = task.getException();
                          Log.e(Constants.LOG_TAG, "Failed to join multiplayer room.", e);
                          return null;
                      }
                  }
              });
  </code></pre>
  
  <p>How can I change the timeout so the client would wait more before throwing the exception?</p>
  
  <p><strong>Note.</strong> I'm not using OkHttp, Retrofit or the default system Networking functions, I'm using Firebase Cloud Functions library (<code>getHttpsCallable</code>) to call the function.</p>