fix refresh & update workflow

This commit is contained in:
dskvr
2022-12-17 23:04:58 +01:00
parent 7805b362e4
commit 7444da8764
3 changed files with 7 additions and 10 deletions

View File

@@ -31,9 +31,12 @@ jobs:
run: yarn docker:push run: yarn docker:push
- name: Pull new image and restart - name: Pull new image and restart
uses: appleboy/ssh-action@v0.1.2 uses: appleboy/ssh-action@v0.1.6
with: with:
host: ${{secrets.SSH_DEPLOY_HOST}} host: ${{secrets.SSH_DEPLOY_HOST}}
key: ${{secrets.SSH_DEPLOY_KEY}} key: ${{secrets.SSH_DEPLOY_KEY}}
username: deploy 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

View File

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

View File

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