Last active
December 6, 2015 05:39
-
-
Save tnuki10/ef577424a66e62c597eb to your computer and use it in GitHub Desktop.
Google App Engine for GoでのDeadlineの変更
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"appengine" | |
"appengine/urlfetch" | |
) | |
// 中省略 | |
c := appengine.NewContext(r) | |
client := urlfetch.Client(c) | |
// deadline変更 | |
transport := &urlfetch.Transport{ | |
Context: c, | |
Deadline: 30 * time.Second, | |
} | |
client.Transport = transport | |
//これだけで行けた | |
client := urlfetch.Client(c) | |
client.Timeout = 30 * time.Second |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment