Skip to content

Commit

Permalink
Fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
githubsaturn committed Apr 28, 2024
1 parent 2b6500f commit fb819ec
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 29 deletions.
5 changes: 4 additions & 1 deletion src/api/BaseApi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
class BaseApi {
public data: any

constructor(public status: number, public description: string) {
constructor(
public status: number,
public description: string
) {
this.data = {}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/datastore/AppsDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ function isPortValid(portNumber: number) {
class AppsDataStore {
private encryptor: CaptainEncryptor

constructor(private data: configstore, private namepace: string) {}
constructor(
private data: configstore,
private namepace: string
) {}

setEncryptor(encryptor: CaptainEncryptor) {
this.encryptor = encryptor
Expand Down
5 changes: 4 additions & 1 deletion src/datastore/RegistriesDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ const DEFAULT_DOCKER_REGISTRY_ID = 'defaultDockerRegId'
class RegistriesDataStore {
private encryptor: CaptainEncryptor

constructor(private data: configstore, public namepace: string) {}
constructor(
private data: configstore,
public namepace: string
) {}

setEncryptor(encryptor: CaptainEncryptor) {
this.encryptor = encryptor
Expand Down
16 changes: 8 additions & 8 deletions src/docker/DockerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1685,14 +1685,14 @@ const connectionParams: Docker.DockerOptions =
socketPath: CaptainConstants.dockerSocketPath,
}
: dockerApiAddressSplited.length === 2
? {
host: dockerApiAddressSplited[0],
port: Number(dockerApiAddressSplited[1]),
}
: {
host: `${dockerApiAddressSplited[0]}:${dockerApiAddressSplited[1]}`,
port: Number(dockerApiAddressSplited[2]),
}
? {
host: dockerApiAddressSplited[0],
port: Number(dockerApiAddressSplited[1]),
}
: {
host: `${dockerApiAddressSplited[0]}:${dockerApiAddressSplited[1]}`,
port: Number(dockerApiAddressSplited[2]),
}

connectionParams.version = CaptainConstants.configs.dockerApiVersion

Expand Down
5 changes: 4 additions & 1 deletion src/user/DockerRegistryHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import BuildLog from './BuildLog'

class DockerRegistryHelper {
private registriesDataStore: RegistriesDataStore
constructor(dataStore: DataStore, private dockerApi: DockerApi) {
constructor(
dataStore: DataStore,
private dockerApi: DockerApi
) {
this.registriesDataStore = dataStore.getRegistriesDataStore()
}

Expand Down
9 changes: 6 additions & 3 deletions src/user/FeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ export default class FeatureFlags {
Logger.e(error)
})
.then(function () {
setTimeout(() => {
self.refreshFeatureFlags()
}, 1000 * 3600 * 19.3) // some random hour to avoid constant traffic
setTimeout(
() => {
self.refreshFeatureFlags()
},
1000 * 3600 * 19.3
) // some random hour to avoid constant traffic
})
}
}
5 changes: 4 additions & 1 deletion src/user/pro/OtpAuthenticator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { TwoFactorAuthResponse } from '../../models/IProFeatures'
import ProManager from './ProManager'

export default class OtpAuthenticator {
constructor(private dataStore: DataStore, private proManager: ProManager) {}
constructor(
private dataStore: DataStore,
private proManager: ProManager
) {}

set2fa(
doEnable: boolean,
Expand Down
17 changes: 10 additions & 7 deletions src/user/system/BackupManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,16 @@ export default class BackupManager {
)}-${now.valueOf()}`}${`-ip-${mainIP}.tar`}`
fs.moveSync(tarFilePath, newName)

setTimeout(() => {
try {
fs.removeSync(newName)
} catch (err) {
// nom nom
}
}, 1000 * 3600 * 2)
setTimeout(
() => {
try {
fs.removeSync(newName)
} catch (err) {
// nom nom
}
},
1000 * 3600 * 2
)

return Authenticator.getAuthenticator(
namespace
Expand Down
15 changes: 9 additions & 6 deletions src/user/system/LoadBalancerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,12 +819,15 @@ class LoadBalancerManager {
// this random schedule helps to avoid retrying at the same time of
// the day in case if that's our super high traffic time

setTimeout(function () {
self.renewAllCertsAndReload(dataStore) //
.catch((err) => {
Logger.e(err)
})
}, 1000 * 3600 * 20.3)
setTimeout(
function () {
self.renewAllCertsAndReload(dataStore) //
.catch((err) => {
Logger.e(err)
})
},
1000 * 3600 * 20.3
)

return self.certbotManager
.renewAllCerts() //
Expand Down

0 comments on commit fb819ec

Please sign in to comment.