mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-04 14:38:50 +00:00
refactor(update): add convar for mysql_versioncheck
For those who don't like to be reminded of updates. Also don't report errors during fetch, since it doesn't matter to users.
This commit is contained in:
1 parent
050eef58b9
commit
23bcf90885
1 file changed
+5
-5
+5
-5
@@ -1,7 +1,8 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { resourceName } from '../config';
|
||||
|
||||
setTimeout(async () => {
|
||||
if (GetConvar('mysql_versioncheck', 'true') === 'true') {
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
const response = await fetch(`https://api.github.com/repos/overextended/oxmysql/releases/latest`);
|
||||
|
||||
@@ -28,7 +29,6 @@ setTimeout(async () => {
|
||||
console.log(
|
||||
`^3There is ${updateMessage} available for oxmysql - please update to the latest release (current version: ${currentVersion[0]})\r\n${release.html_url}^0`
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}, 1000);
|
||||
} catch (e) {}
|
||||
}, 1000);
|
||||
}
|
||||
Reference in new issue
Block a user