ninjapeps's avatar

ninjapeps wrote a reply+100 XP

2d ago

Creating an event to check for inactivity

I'm using reverb to listen to the events and update the auction display. Up to three are active at any given time and as soon as one auction closes, it's removed from the display and the next item is put up. Client wants the auctions to close after 3 to 5 seconds of inactivity. I need real-time updates since users won't have time to refresh the page hence reverb.

The way they want this work is weird to me since it's not at all how a site like Ebay works but it's apparently something that's done in Japan and they want to make something like it over in our country.

ninjapeps's avatar

ninjapeps wrote a reply+100 XP

2d ago

Creating an event to check for inactivity

Sorry, I just realized that I call events using broadcast inside an event, not through jobs. Delay doesn't seem to be something I can use with broadcast.

ninjapeps's avatar

ninjapeps wrote a reply+100 XP

2d ago

Creating an event to check for inactivity

Many thanks. This is helpful to know, though I feel that it could still end up with there being too many close auction jobs on the queue. Still much better than what I originally did.

I'm still very new to reverb and went from making a very small scale chat app to a potentially large auction app in the span of one project so I feel out of my depth.

ninjapeps's avatar

ninjapeps started a new conversation+100 XP

2d ago

Creating an event to check for inactivity

I'm trying to make a sort of real time auction site with each auction ideally lasting only as long as people are bidding. If no new bids are detected within a few seconds of the last bid, then the auction will close. Originally, I did this by having an event fire off when someone bids that sleeps for a few seconds and then checks if there are any new bids when it finally runs. It worked but then I realized that the event queue would get clogged by all of these inactivity checker events.

Is there a way to remove specific events from the queue? Or some other better way to do this? Thanks.

ninjapeps's avatar

ninjapeps wrote a reply+100 XP

5d ago

Site not receiving events in prod

Someone on a different forum suggested that there could be a connection issue since there were repeated reconnection attempts every few seconds. Screenshot of dev tools output added to the post.

ninjapeps's avatar

ninjapeps started a new conversation+100 XP

1w ago

Site not receiving events in prod

I have a site that uses reverb. Events are working just fine on my machine. However, it doesn't receive anything once uploaded to the dev server.

window.addEventListener('DOMContentLoaded', function() {
  window.Echo.channel('makebid')
    .listen('MakeBid', (event) => {
      console.log('bid');
    })

  window.Echo.channel('closeauction')
    .listen('EndAuction', (event) => {
      console.log('end');
    })
});

Nothing got output to console.

Supervisor is set up to run reverb and queue. The logs aren't displaying any errors from reverb. The queue log is showing events running and completing. Browser is able to connect to the websocket.

What else could be causing this? I don't know what else I need to check in order to properly debug this.

EDIT: I was informed elsewhere that there appears to be a connection issue since there are repeated reconnection attempts shown on dev tools. Not sure how to add images here so screenshot here: https://imgur.com/a/BZW9d5Z

And in case there could be an issue with my nginx config: https://docs.google.com/document/d/1_EDmIVutr0Ol1ARw3L8BIdqjsAbd-S8chEzaQbnxd5E/edit?tab=t.0

EDIT 2: To my knowledge, no one has made any server changes but now I'm getting this error: https://imgur.com/a/KarIb8U

EDIT 3: Issue has been resolved. Changed proxy pass from 0.0.0.0 to 127.0.0.1 and everything worked properly.

ninjapeps's avatar

ninjapeps wrote a reply+100 XP

1w ago

Need help setting up for prod

I had already solved this a while ago and it turned out the only thing I had to do was run npm run build. After doing that, everything ran just fine.

Yes, I believe that error came from supervisor. 8080 was unavailable and 6001 was the port I kept seeing tutorials recommend so I changed it to that.

As for the nginx configurations, most were defaults provided by the server and the ones for reverb were taken from a tutorial.

ninjapeps's avatar

ninjapeps wrote a reply+100 XP

1mo ago

Need help setting up for prod

Yes, reverb is on the same server.

To my knowledge, there's no firewall blocking either 8080 or 6001.

User is authenticated.

ninjapeps's avatar

ninjapeps started a new conversation+100 XP

1mo ago

Need help setting up for prod

(I keep getting a note saying I can't post links yet even though there aren't any links in my post so I've replaced http with hype)

I've got reverb working on my local machine. Now I'm having difficulty getting it to work on the server. I think I've finally gotten supervisor to run properly already so now my only issue is that the sockets can't be read. In the network tab of dev tools, the ws links all have the domain localhost:8080 and a status of blocked.

Not sure if the issue is with my env values

REVERB_APP_ID=396160  
REVERB_APP_KEY=ujjxjmewenx3ruqys4bf  
REVERB_APP_SECRET=ebqtdneudtyu3vategoj  
REVERB_SERVER_HOST=127.0.0.1  
REVERB_SERVER_PORT=6001  
REVERB_HOST="\<my site's url\>"  
REVERB_PORT=443  
REVERB_SCHEME=https  
BROADCAST_CONNECTION=reverb 

or with my Nginx config

I can't use 8080 because I get this error when I try:

Failed to listen on "tcp://127.0.0.1:8080": Address already in use (EADDRINUSE)

Any help would be appreciated. Thank you.

EDIT: I forgot I made this thread. Turned out the only reason for my problem was that I had to run npm run build again. After that, it worked properly.