Skip to content

Commit

Permalink
Issue #14: change of tack again ... MCPlatformSupport class>>readStre…
Browse files Browse the repository at this point in the history
…amForUrl:user:passwd:do: is a better choice for retry logic as it covers Gofer allFileNames and package load ...
  • Loading branch information
dalehenrich committed Mar 24, 2015
1 parent f567f28 commit 4d27818
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ patchForGsDevKitIssue60
self log: 'Installing patchForGsDevKitIssue60: ' cls name asString.
cls compile: self patchForGsDevKitIssue60Source1 classified: protocol ].
Smalltalk
at: #'MCHttpRepository'
at: #'MCPlatformSupport'
ifPresent: [ :cls |
self log: 'Installing patchForGsDevKitIssue60: ' cls name asString.
cls compile: self patchForGsDevKitIssue60Source2 classified: protocol ]
self log: 'Installing patchForGsDevKitIssue60: ' cls name asString , ' class'.
cls class
compile: self patchForGsDevKitIssue60Source2
classified: protocol ]
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,27 @@ patching
patchForGsDevKitIssue60Source2
"https://github.com/GsDevKit/GsDevKit/issues/60"

"MCHttpRepository>>allFileNames"
"MCPlatformSupport class>>readStreamForUrl:user:passwd:do:"

^ 'allFileNames
| retries |
^ 'readStreamForUrl: url user: user passwd: password do: aBlock
| contents retries |
retries := 0.
[ retries < 3 ]
whileTrue: [
[
MCPlatformSupport
readStreamForUrl: self locationWithTrailingSlash , ''?C=M;O=D''
user: self user
passwd: self password
do: [ :str | ^ self parseFileNamesFromStream: str ].
^ self error: ''Could not access '' , location ]
contents := HTTPSocket
httpGet: url
args: nil
user: user
passwd: password ]
on: Error
do: [ :ex |
Transcript
cr;
show:
''Error during allFileNames. Retrying ('' , retries printString , '')'' ].
retries := retries + 1 ]'
''Error during MCPlatformSupport class>>readStreamForUrl:user:passwd:do:. Retrying (''
, retries printString , '')'' ].
retries := retries + 1 ].
^ contents isString
ifTrue: [ nil ]
ifFalse: [ aBlock value: contents ]'
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"metacelloRepositoryDescription" : "dkh 09/05/2014 12:23",
"notify:" : "dkh 09/05/2014 16:56",
"packageReportOn:" : "dkh 09/15/2014 13:48",
"patchForGsDevKitIssue60" : "dkh 03/23/2015 16:41",
"patchForGsDevKitIssue60" : "dkh 03/23/2015 17:00",
"patchForGsDevKitIssue60Source1" : "dkh 03/23/2015 16:43",
"patchForGsDevKitIssue60Source2" : "dkh 03/23/2015 16:40",
"patchForGsDevKitIssue60Source2" : "dkh 03/23/2015 17:01",
"projectReportOn:" : "dkh 09/11/2014 16:38",
"projectVersion:" : "dkh 09/15/2014 13:13",
"registrationFor:" : "dkh 11/16/2014 20:06",
Expand Down

0 comments on commit 4d27818

Please sign in to comment.