Skip to content

Commit

Permalink
Merge branch 'main' into minio
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Jan 27, 2025
2 parents f8336de + 67da6a9 commit 11ba997
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 19 deletions.
2 changes: 1 addition & 1 deletion openc3-cosmos-cmd-tlm-api/Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: bin/rails s -b 0.0.0.0 -p 2901
ws: anycable-go --host 0.0.0.0 --port 3901 --path /openc3-api/cable
ws: anycable-go --host 0.0.0.0 --port 3901 --path /openc3-api/cable --log_level error
rpc: bundle exec anycable --broadcast_adapter http
Original file line number Diff line number Diff line change
Expand Up @@ -774,15 +774,26 @@ export default {

this.progress = 0
this.processButtonText = 'Cancel'
// We're using the ActionCable implementation of AnyCable via mapping of events:
// https://github.com/anycable/anycable-client/blob/master/packages/core/create-cable/index.js#L218
// Here's the anycable lifecycle: https://github.com/anycable/anycable-client/blob/master/docs/lifecycle.md
this.cable
.createSubscription('StreamingChannel', window.openc3Scope, {
received: (data) => this.received(data),
connected: () => this.onConnected(),
disconnected: () => {
this.$notify.caution({
body: 'OpenC3 backend connection disconnected.',
})
// The "disconnect" event is trigger when the connection was lost or the server disconnected the client.
// disconnect maps to disconnected with allowReconnect: true
// close maps to disconnected with allowReconnect: false
disconnected: (data) => {
// If allowReconnect is true it means we got a disconnect due to connection lost or server disconnect
// If allowReconnect is false this is a normal server close or client close
if (data.allowReconnect) {
this.$notify.caution({
body: 'OpenC3 backend connection disconnected.',
})
}
},
// close maps to rejected if there is an error
rejected: () => {
this.$notify.caution({
body: 'OpenC3 backend connection rejected.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,10 @@ export default {
return
}
// Check for a future End Time
if (this.startEndTime.end_time) {
if (
this.startEndTime.end_time &&
this.startEndTime.end_time > new Date().getTime() * 1000000
) {
this.warningText =
'Note: End date/time is greater than current date/time. Data will continue to stream in real-time until ' +
this.endDate +
Expand All @@ -513,12 +516,16 @@ export default {
this.canStart = true
this.connectionFailure = false
},
disconnected: () => {
this.stop()
this.canStart = false
this.warningText = 'OpenC3 backend connection disconnected.'
this.warning = true
this.connectionFailure = true
disconnected: (data) => {
// If allowReconnect is true it means we got a disconnect due to connection lost or server disconnect
// If allowReconnect is false this is a normal server close or client close
if (data.allowReconnect) {
this.stop()
this.canStart = false
this.warningText = 'OpenC3 backend connection disconnected.'
this.warning = true
this.connectionFailure = true
}
},
rejected: () => {
this.warningText = 'OpenC3 backend connection rejected.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1038,12 +1038,16 @@ export default {
connected: () => {
this.addItemsToSubscription(this.items)
},
disconnected: () => {
this.errors.push({
type: 'disconnected',
message: 'OpenC3 backend connection disconnected',
time: new Date().getTime(),
})
disconnected: (data) => {
// If allowReconnect is true it means we got a disconnect due to connection lost or server disconnect
// If allowReconnect is false this is a normal server close or client close
if (data.allowReconnect) {
this.errors.push({
type: 'disconnected',
message: 'OpenC3 backend connection disconnected',
time: new Date().getTime(),
})
}
},
rejected: () => {
this.errors.push({
Expand Down
2 changes: 1 addition & 1 deletion openc3-cosmos-script-runner-api/Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: bin/rails s -b 0.0.0.0 -p 2902
ws: anycable-go --host 0.0.0.0 --port 3902 --path /script-api/cable
ws: anycable-go --host 0.0.0.0 --port 3902 --path /script-api/cable --log_level error
rpc: bundle exec anycable --broadcast_adapter http

0 comments on commit 11ba997

Please sign in to comment.