Browse Source

fix refresh & update workflow

update/libraries
dskvr 2 years ago
parent
commit
7444da8764
  1. 7
      .github/workflows/deploy.yml
  2. 1
      nginx/conf.d/default.conf
  3. 7
      src/components/RefreshComponent.vue

7
.github/workflows/deploy.yml

@ -31,9 +31,12 @@ jobs:
run: yarn docker:push
- name: Pull new image and restart
uses: appleboy/ssh-action@v0.1.2
uses: appleboy/ssh-action@v0.1.6
with:
host: ${{secrets.SSH_DEPLOY_HOST}}
key: ${{secrets.SSH_DEPLOY_KEY}}
username: deploy
script: docker pull registry.digitalocean.com/sandwich-farm/nostr-relay-status:latest && docker-compose stop && docker-compose up -d
script: |
docker pull registry.digitalocean.com/sandwich-farm/nostr-relay-status:latest
docker-compose stop
docker-compose up -d

1
nginx/conf.d/default.conf

@ -9,7 +9,6 @@ server {
}
location ~ /?(.*)$ {
index index.html;
}
}

7
src/components/RefreshComponent.vue

@ -27,13 +27,12 @@ const localMethods = {
},
setRefreshInterval: function(){
this.interval = setInterval(() => {
if(!this.preferences.refresh) return false
this.preferences = this.getState('preferences') || this.preferences
this.refreshData.untilNext = this.timeUntilRefresh()
this.refreshData.sinceLast = this.timeSinceRefresh()
if(this.isExpired())
if(this.isExpired() && this.preferences.refresh)
this.invalidate()
}, 1000)
@ -53,7 +52,6 @@ export default defineComponent({
sinceLast: this.timeSinceRefresh()
})
if(this.preferences.refresh)
this.setRefreshInterval()
},
updated(){
@ -66,9 +64,6 @@ export default defineComponent({
this.refreshData.untilNext = this.timeUntilRefresh()
this.refreshData.sinceLast = this.timeSinceRefresh()
if(this.preferences.refresh)
this.setRefreshInterval()
},
computed: {},
methods: Object.assign(localMethods, sharedMethods),

Loading…
Cancel
Save