$ git clone --mirror https://bitbucket.org/tommcfarlin/acme-repository.git
$ cd acme-repository
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
annotations: | |
deployment.kubernetes.io/revision: "8" | |
field.cattle.io/creatorId: user-8xxx7 | |
field.cattle.io/publicEndpoints: '[{"addresses":["xxx.xxx.xxx.135"],"port":32754,"protocol":"TCP","serviceName":"default:nginx-volume-test-nodeport","allNodes":true}]' | |
creationTimestamp: "2019-12-08T14:27:49Z" | |
generation: 9 | |
labels: |
class ServiceManager(private val context: Context) { | |
private val globalsConstraints = | |
Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build() | |
// Add new jobs here | |
private val allServicesAvailables = | |
listOf( | |
Service(IncidentsSynchronizationWorker::class.java, IncidentsSynchronizationWorker.TAG), | |
Service(AttachmentsCleaningWorker::class.java, AttachmentsCleaningWorker.TAG) |
fun isInternetAvailable() { | |
try { | |
val command = "ping -c 1 google.com" | |
if (Runtime.getRuntime().exec(command).waitFor() == 0) { | |
viewAction.onNext(LauncherAction.InternetAvailable) | |
} else { | |
viewAction.onNext( | |
LauncherAction.NoNetwork( | |
R.string.launcher_error_no_network_title, | |
R.string.launcher_error_no_network_message |