TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #411 · 9 фев.

reload_flag="" if [[ -n "${DEBUG}" ]]; then reload_flag="--reload" fi if [[ -n "${WORKER_COUNT}" ]]; then workers=${WORKER_COUNT} else workers=2 fi gunicorn --workers ${workers} \ --bind 0.0.0.0:8000 \ ${reload_flag} main.wsgi Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно? На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX. :- для установки значений по умолчанию ${WORKER_COUNT:-2} Если переменная не объявлена, то будет дефолтное значение 2. :+ подставляет указанный текст, если переменная не пуста ${DEBUG:+--reload} Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере. Итого наш скрипт может выглядеть так: gunicorn --workers ${WORKER_COUNT:-2} \ --bind 0.0.0.0:8000 \ ${DEBUG:+--reload} main.wsgi Есть еще два оператора. := не только подставить дефолтное значение, но и присвоить его переменной, если она пуста # никаких переменных еще нет VAL1=${VAL2:=hello} # теперь доступны обе echo $VAL1 $VAL2 # hello hello :? остановить выполнение с ошибкой, если переменной нет. echo ${MISS:?is required} bash: MISS: is required Код выхода будет 1. #tricks#linux

Резултати

Пронајдени 2 слични објави

Пребарај: #catchain2

当前筛选 #catchain2清除筛选
Crypto M - Crypto News

@CryptoM · Post #64742 · 09.04.2026 г., 17:17

🚀 TON's Catchain 2.0 Upgrade Enhances Speed and Validator Rewards TON has announced the implementation of its Catchain 2.0 consensus upgrade, which significantly improves transaction speed and validator incentives. According to NS3.AI, the upgrade reduces block times to 400 milliseconds and accelerates payment settlement to approximately one second. Additionally, the change is expected to increase annual inflation to 3.6%, up from around 0.6%, as the faster block production boosts rewards for validators. #TON#Catchain2.0 #Blockchain#ConsensusUpgrade#TransactionSpeed#ValidatorRewards#Cryptocurrency#CryptoNews#BlockchainTechnology#DeFi

Crypto M - Crypto News

@CryptoM · Post #64902 · 10.04.2026 г., 08:17

🚀 TON Declines Over 24% Year-to-Date Despite Wallet Accumulation and Network Upgrade TON has experienced a decline of over 24% since the beginning of the year. According to NS3.AI, despite this downturn, the top 100 wallets have accumulated an additional 189,730 TON in the past three months. This week, TON implemented the Catchain 2.0 upgrade, which has reduced confirmation times to less than one second for Telegram mini-apps, payments, and high-frequency activities. The network's seven-phase roadmap includes plans for future fee reductions. #TON#cryptocurrency#blockchain#wallets#networkupgrade#Catchain2#Telegram#cryptoaccumulation#feereduction#highfrequencytransactions