I was worried about that, and it appears Symfony does not kill messenger consumers while a message is being handled, only after the message is handled . This is true for all --limit , --memory-limit , --time-limit options. Let’s look at the code of the messenger:consume command ( source ): 1 // when --limit 2 $this-> eventDispatcher -> addSubscriber ( new StopWorkerOnMessageLimitListener ( $ limit…
I discovered Mago , a PHP toolchain written in Rust, on Reddit a couple of days back. It recently published version 1.0. I am testing it primarily as a candidate to replace PHPStan. PHPStan has been incredible in terms of the features it provide. But, it’s slow. Having experienced a near-instant DX with typescript, PHPStan's speed has always been a problem. In Hyvor Relay repo, which has about…
Until last year, I rarely read any books beyond textbooks. I had never been a good reader. Whenever I started reading a book, I would try to recall what I had read in the previous chapters, but I remembered almost nothing. So, I would start over. This cycle continued, and I never managed to finish a single book. Then, in March of this year, I found myself in a small town called…
My requirements: Use the database for all caching in the app Cache should reuse the connection I already have in the Symfony app via Doctrine It took longer than I expected to figure that out. Symfony’s Cache documentation was confusing to me. Adapters? Providers? Direct Solution If you don’t have much time, here’s what you need to do: config/packages/config.yaml 1 framework : 2 cache : 3 app :…
I noticed today that some billing-related jobs in HYVOR production failed, but these were not reported to Sentry, which was extremely concerning (thankfully, they were logged in the failed_jobs table). Turns out, due to how Laravel handles queues, exceptions are not thrown outside of the job. Sentry recommends manually reporting them to Sentry in the job’s failed method. However, I am not going to…
Today, some staging deployments failed and I found out one of the servers has run out of disk space, where /var/lib/docker/containers had grown unexpectedly large because of large log files. Finding the largest folders: 1 # start with / 2 sudo du -h -x --max-depth=1 / | sort -hr 3 4 # then go into largest one one by one 5 sudo du -h -x --max-depth=1 /var | sort -hr 6 sudo du -h -x --max-depth=1…
Well, I’ve been learning Rust. Being a web dev, Rust is exciting territory. After working on some toy projects, I decided it was time to contribute to some open-source projects. Building GUIs with Rust always fascinated me so I kept looking for projects to work on. The first exciting project I found was Sniffnet , a GUI app to monitor internet traffic. I went through the codebase. It uses Iced.rs…
A few months ago, I suddenly thought it was cool to buy a Raspberry Pi. Indeed, it was cool! Raspberry Pi 4 I then set up a headless (no monitor, no keyboard) Raspberry Pi with Pihole installed for network-level ad blocking . Pihole does this by working as a DNS resolver that blocks (well, technically, resolves into an invalid IP address) known tracker/ad domains. So, I won’t need an extension on…
Laravel polymorphism is a quite elegant solution. Yesterday, I came up with a problem with the *able_type column value when using extended versions of the model. The Problem Most our code at HYVOR has something called access objects: 1 // Project.php 2 class Project extends Model 3 {} 4 5 // AccessProject.php 6 class AccessProject extends Project 7 {} It simply extends a Laravel model. Then, in…
I have been working on integrating Meilisearch into Hyvor Talk as a secondary database to make comments search faster. Meilisearch is a fine solution for our use case, however, when it comes to automated testing, Meilisearch’s asynchronous document handling poses a problem. Our search endpoint tests look like this (we use PHP and Laravel): 1 it ( ' searches for comments ' , function () { 2 // seed…
This article is about how I came up with a solution to export large datasets into a JSON file in PHP. If you just need a solution, use the php-json-exporter library. Computers have become cheaper, but RAM capacity is still expensive. In a usual cloud provider, an 8GB VPS costs around 20-40$/month. 8GB is sufficient for most tasks. For example, a simple PHP request takes about 3MB-10MB when…