Browse Source

Remove old file when checking Juvenes

Toni Fadjukoff 10 years ago
parent
commit
2b85c7e9bc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      juvenes.pl

+ 1 - 1
juvenes.pl View File

@@ -98,7 +98,7 @@ sub get_juvenes_restaurants {
98 98
       my $temp_fname = "juvenes$count-$weekday.temp.js";
99 99
       my $url = "http://www.juvenes.fi/DesktopModules/Talents.LunchMenu/LunchMenuServices.asmx/GetMenuByWeekday?KitchenId=$kitchen&MenuTypeId=$menutype&Week=$week&Weekday=$weekday&lang='fi'&format=json";
100 100
       if (!-f $temp_fname || !$use_old) {
101
-        system("wget -q --timeout=10 -O $temp_fname.tmp \"$url\" && mv $temp_fname.tmp $temp_fname");
101
+        system("rm -f $temp_fname && wget -q --timeout=10 -O $temp_fname.tmp \"$url\" && mv $temp_fname.tmp $temp_fname");
102 102
       }
103 103
       if (-f $temp_fname) {
104 104
         open(FILE, $temp_fname);