Archived
1
0

cli: Add --disable-update-check flag

Closes #2361
This commit is contained in:
Anmol Sethi
2020-11-25 11:37:40 -05:00
parent 27f0f195a8
commit cc18175ce3
3 changed files with 18 additions and 7 deletions

View File

@ -813,7 +813,7 @@ new file mode 100644
index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152ed407146
--- /dev/null
+++ b/src/vs/server/browser/client.ts
@@ -0,0 +1,239 @@
@@ -0,0 +1,241 @@
+import { Emitter } from 'vs/base/common/event';
+import { URI } from 'vs/base/common/uri';
+import { localize } from 'vs/nls';
@ -967,7 +967,7 @@ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152
+
+ const logService = (services.get(ILogService) as ILogService);
+ const storageService = (services.get(IStorageService) as IStorageService);
+ const updateCheckEndpoint = path.join(options.base, "/update/check")
+ const updateCheckEndpoint = path.join(options.base, "/update/check");
+ const getUpdate = async (): Promise<void> => {
+ logService.debug('Checking for update...');
+
@ -987,8 +987,8 @@ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152
+
+ const lastNoti = storageService.getNumber('csLastUpdateNotification', StorageScope.GLOBAL);
+ if (lastNoti) {
+ // Only remind them again after two days.
+ const timeout = 1000*60*24*2;
+ // Only remind them again after 1 week.
+ const timeout = 1000*60*24*7;
+ const threshold = lastNoti + timeout;
+ if (Date.now() < threshold) {
+ return;
@ -1011,7 +1011,9 @@ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152
+ });
+ };
+
+ updateLoop();
+ if (!options.disableUpdateCheck) {
+ updateLoop();
+ }
+
+ // This will be used to set the background color while VS Code loads.
+ const theme = storageService.get('colorThemeData', StorageScope.GLOBAL);
@ -1448,14 +1450,15 @@ new file mode 100644
index 0000000000000000000000000000000000000000..0a4a91e5e36bda7f888feedda348aaff5fe32d27
--- /dev/null
+++ b/src/vs/server/ipc.d.ts
@@ -0,0 +1,132 @@
@@ -0,0 +1,133 @@
+/**
+ * External interfaces for integration into code-server over IPC. No vs imports
+ * should be made in this file.
+ */
+export interface Options {
+ disableTelemetry: boolean
+ base: string
+ disableTelemetry: boolean
+ disableUpdateCheck: boolean
+}
+
+export interface InitMessage {