mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
* Handle HTTP 202 Fixes #564 After some testing, it seems GitHub seems to be able to process the chrunching of statistics for every repository I tested in around 2 seconds. So a delay of around 5 seconds should be plenty to be very certain that the next try should succeed. Another option would be to put this value lower and possibly waste an extra retry on it. * Only re-request data if HEAD or GET (those are 'safe') to e.g. avoid running a duplicate POST or PUT, that can change stuff on the server Using RFC 2616 and https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html as guideline * Fix testStatistics * change wait time to 2 secs
43 lines
2.7 KiB
Python
43 lines
2.7 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
############################ Copyrights and license ############################
|
|
# #
|
|
# Copyright 2013 AKFish <akfish@gmail.com> #
|
|
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
|
|
# Copyright 2016 Jakub Wilk <jwilk@jwilk.net> #
|
|
# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
|
|
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
|
|
# Copyright 2018 sfdye <tsfdye@gmail.com> #
|
|
# Copyright 2018 Maarten Fonville <maarten.fonville@gmail.com #
|
|
# #
|
|
# This file is part of PyGithub. #
|
|
# http://pygithub.readthedocs.io/ #
|
|
# #
|
|
# PyGithub is free software: you can redistribute it and/or modify it under #
|
|
# the terms of the GNU Lesser General Public License as published by the Free #
|
|
# Software Foundation, either version 3 of the License, or (at your option) #
|
|
# any later version. #
|
|
# #
|
|
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
|
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
|
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
|
|
# details. #
|
|
# #
|
|
# You should have received a copy of the GNU Lesser General Public License #
|
|
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
|
# #
|
|
################################################################################
|
|
|
|
|
|
REQ_IF_NONE_MATCH = "If-None-Match"
|
|
REQ_IF_MODIFIED_SINCE = "If-Modified-Since"
|
|
PROCESSING_202_WAIT_TIME = 2
|
|
|
|
# ##############################################################################
|
|
# Response Header #
|
|
# (Lower Case) #
|
|
# ##############################################################################
|
|
RES_ETAG = "etag"
|
|
RES_LAST_MODIFIED = "last-modified"
|