File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use App \Models \InstanceSettings ;
6
6
use App \Models \Server ;
7
+ use Illuminate \Support \Facades \File ;
8
+ use Illuminate \Support \Facades \Http ;
7
9
use Lorisleiva \Actions \Concerns \AsAction ;
8
10
9
11
class UpdateCoolify
@@ -25,6 +27,11 @@ public function handle($manual_update = false)
25
27
return ;
26
28
}
27
29
CleanupDocker::dispatch ($ this ->server , false )->onQueue ('high ' );
30
+ $ response = Http::retry (3 , 1000 )->get ('https://cdn.coollabs.io/coolify/versions.json ' );
31
+ if ($ response ->successful ()) {
32
+ $ versions = $ response ->json ();
33
+ File::put (base_path ('versions.json ' ), json_encode ($ versions , JSON_PRETTY_PRINT ));
34
+ }
28
35
$ this ->latestVersion = get_latest_version_of_coolify ();
29
36
$ this ->currentVersion = config ('version ' );
30
37
if (! $ manual_update ) {
@@ -39,6 +46,8 @@ public function handle($manual_update = false)
39
46
}
40
47
}
41
48
$ this ->update ();
49
+ $ settings ->new_version_available = false ;
50
+ $ settings ->save ();
42
51
} catch (\Throwable $ e ) {
43
52
throw $ e ;
44
53
}
You can’t perform that action at this time.
0 commit comments