Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weather retrieval hangs for minutes #201

Closed
aetonsi opened this issue Sep 25, 2023 · 1 comment · Fixed by #202
Closed

Weather retrieval hangs for minutes #201

aetonsi opened this issue Sep 25, 2023 · 1 comment · Fixed by #202

Comments

@aetonsi
Copy link
Contributor

aetonsi commented Sep 25, 2023

hello,
as i also commented a few months ago here: #149 (comment), sometimes the wttr.in call hangs for minutes, until its timeout (i believe 120 seconds by default).
i don't know why the network call cannot be completed, i think it might have to do with the vpn.
in any case, i think and propose that a -TimeoutSec 3 (or something similar) should be added to Invoke-RestMethod.


         ,.=:!!t3Z3z.,                 u6@NOTEBOOK3W
        :tt:::tt333EE3                 -------------
        Et:::ztt33EEE  @Ee.,      ..,  OS: Windows 11 Pro N [64-bit]
       ;tt:::tt333EE7 ;EEEEEEttttt33#  Host: HP HP Pavilion Laptop 15-eh0xxx
      :Et:::zt333EEQ. SEEEEEttttt33QL  Kernel: 10.0.22631.0
      it::::tt333EEF @EEEEEEttttt33F   Motherboard: HP 87C5
     ;3=*^```'*4EEV :EEEEEEttttt33@.   Uptime: 4 hours 13 minutes
     ,.=::::it=., ` @EEEEEEtttz33QF    Resolution: 1536x864, 1920x1080
    ;::::::::zt33)   '4EEEtttji3P*     PS Packages: 6 Modules
   :t::::::::tt33 :Z3z..  `` ,..g.     Packages: 230 (system), -1 (choco), 7 (scoop)
   i::::::::zt33F AEEEtttt::::ztF      Shell: PowerShell v7.3.7
  ;:::::::::t33V ;EEEttttt::::t3       Terminal: Windows Terminal
  E::::::::zt33L @EEEtttt::::z3F       Theme: Custom (System: Light, Apps: Light)
 {3=*^```'*4E3) ;EEEtttt:::::tZ`       CPU: AMD Ryzen 5 4500U with Radeon Graphics @ 2.371GHz
             ` :EEEEtttt::::z7         GPU: AMD Radeon(TM) Graphics
                 'VEzjt:;;z>*`         CPU Usage: 330 processes [ ■--------- ]
                                       Memory: 8.68 GiB / 19.36 GiB [ ■■■■------ ]
                                       Disk (C:): 356 GiB / 476 GiB [ ■■■■■■■--- ]
                                       Disk (D:): 0 GiB / 0 GiB [ ■■-------- ]
                                       Disk (K:): 3 GiB / 15 GiB [ ■■-------- ]
                                       Disk (L:): 362 GiB / 476 GiB [ ■■■■■■■■-- ]
                                       Battery: Plugged in [ ■■■■■■■■■■ ]
                                       Locale: Italy - English (United States) - Italian (Italy)
                                       Weather: (Network Error)
                                       Local IP: XXX
                                       Public IP: XXX


Invoke-RestMethod : The response ended prematurely.
At C:\tools\winfetch\winfetch.ps1:1356 char:14
+             (Invoke-RestMethod wttr.in/?format="%t+-+%C+(%l)").TrimSt …
+              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (Method: GET, Reques…PowerShell/7.3.7
}:HttpRequestMessage) [Invoke-RestMethod], HttpRequestException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
@aetonsi aetonsi changed the title Weather retrieval hangs for **minutes** Weather retrieval hangs for *minutes* Sep 25, 2023
@aetonsi aetonsi changed the title Weather retrieval hangs for *minutes* Weather retrieval hangs for minutes Sep 25, 2023
@rashil2000
Copy link
Member

Hmmm, would you like to add it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants