Пример #1
0
        public async Task Delete()
        {
            if (_app != null)
            {
                await _app.Delete();

                _app = null;
            }
        }
Пример #2
0
        void MarkAppAsInUse(BaseApp app)
        {
            lock (_inUseFileLock)
            {
                JObject appsInUse = GetInUseAppNames();
                appsInUse[app.Name] = true;

                File.WriteAllText(InUseFilePath, JsonConvert.SerializeObject(appsInUse));
            }
        }
Пример #3
0
        public async Task <dynamic> Run(Language language, JObject requestBody)
        {
            if (_app == null)
            {
                _app = _appManager.GetAppFor(language);

                if (language == Language.Ruby)
                {
                    var linuxApp = _app as LinuxApp;
                    await linuxApp.UploadUserCode(_zipPackagePath);
                }
                else
                {
                    var windowsApp = _app as WindowsApp;
                    await windowsApp.UploadUserCode(_zipPackagePath);
                }
            }

            var json = await _app.SendRequest(new { functionBody = requestBody });

            return(json.functionBody);
        }