Skip to content

Instantly share code, notes, and snippets.

View jsam's full-sized avatar
🦁

sam jsam

🦁
View GitHub Profile
quickstart on  main [?]
❯ pwsh run-tye.ps1
sql-server-db [up]
Error response from daemon: network with name sot-network already exists
WARN[0000] /Users/samuel.picek/soxes/quickstart/quickstart/etc/docker/docker-compose.infrastructure.yml: `version` is obsolete
WARN[0000] /Users/samuel.picek/soxes/quickstart/quickstart/etc/docker/docker-compose.infrastructure.override.yml: `version` is obsolete
[+] Running 7/7
✔ Container prometheus Started 3.7s
✔ Container elasticsearch Running 0.0s
quickstart on  main [!?]
❯ pwsh run-tye.ps1
sql-server-db [up]
Error response from daemon: network with name sot-network already exists
WARN[0000] /Users/samuel.picek/soxes/quickstart/quickstart/etc/docker/docker-compose.infrastructure.yml: `version` is obsolete
WARN[0000] /Users/samuel.picek/soxes/quickstart/quickstart/etc/docker/docker-compose.infrastructure.override.yml: `version` is obsolete
[+] Running 7/7
✔ Container grafana Started 2.8s
✔ Container rabbitmq Running 0.0s
@jsam
jsam / campaign.py
Created November 9, 2023 13:55
update
def update(self, **kwargs):
if "platforms" not in kwargs:
return super(Campaign, self).update(**kwargs)
for platform in kwargs.pop("platforms"):
if not platform.get("name"):
continue
platform_obj = self.get_platform(platform.get("name"))
if not platform_obj:
❯ kubectl logs melon-rent-694d4f788f-pbssx -c migratejob -f
Boot preload disabled. You will need to call preload_translations management command.
INFO:translate_client:Number of fetched translations: 1290
2023-06-16 20:31:32,713 - translate_client - INFO - Number of fetched translations: 1290
INFO:translate_client:Number of already cached translations: 1290
2023-06-16 20:31:32,728 - translate_client - INFO - Number of already cached translations: 1290
2023-06-16 20:31:32,728 - translate_client - INFO - Number of new translations to cache: 0
INFO:translate_client:Number of new translations to cache: 0
INFO:translate_client:There are no new translations to cache!
2023-06-16 20:31:32,729 - translate_client - INFO - There are no new translations to cache!
root@melon-rent-6db56b8668-fqh2f:/opt/melon# poetry run python manage.py preload_translations
Boot preload disabled. You will need to call preload_translations management command.
2023-06-07 11:09:49,090 - translate_client - INFO - Number of fetched translations: 1280
INFO:translate_client:Number of fetched translations: 1280
2023-06-07 11:09:49,109 - translate_client - INFO - Number of already cached translations: 1280
INFO:translate_client:Number of already cached translations: 1280
2023-06-07 11:09:49,109 - translate_client - INFO - Number of new translations to cache: 0
INFO:translate_client:Number of new translations to cache: 0
2023-06-07 11:09:49,119 - translate_client - INFO - There are no new translations to cache!
INFO:translate_client:There are no new translations to cache!
root@melon-rent-6db56b8668-fqh2f:/opt/melon# poetry run python manage.py preload_translations
Boot preload disabled. You will need to call preload_translations management command.
2023-06-07 10:48:19,783 - translate_client - INFO - Number of fetched translations: 1280
INFO:translate_client:Number of fetched translations: 1280
2023-06-07 10:48:19,803 - translate_client - INFO - Number of already cached translations: 1280
INFO:translate_client:Number of already cached translations: 1280
2023-06-07 10:48:19,803 - translate_client - INFO - Number of new translations to cache: 0
INFO:translate_client:Number of new translations to cache: 0
2023-06-07 10:48:19,820 - translate_client - INFO - There are no new translations to cache!
INFO:translate_client:There are no new translations to cache!
@jsam
jsam / a.py
Last active June 5, 2023 09:17
example api
cache = redis.Redis(host='localhost', port=6379, db=0)
def check_view_refresh(func):
@wraps(func)
def wrapper(self, key):
views = key.views.split(",")
query = (View.name == views.pop(0))
for vw in views:
query |= (View.name == vw)
@jsam
jsam / __init__.py
Created May 22, 2023 10:54
__init__.py
"""Melon Translate client."""
class _InitializeModule:
_instance = None
def __new__(cls, *args, **kwargs):
if not cls._instance:
cls._instance = super().__new__(cls, *args, **kwargs)
return cls._instance
@jsam
jsam / example.py
Created May 17, 2023 09:53
Sanin example
def test_enqueue_geohash_fetch(redis_conn):
enqueue_geohash_fetch()
# NOTE: provjeris ovjde da li je job enqueuan na zadanom queue i ima odgovarajuce parametrom
redis_conn.get("___")
@task
def enqueue_geohash_fetch():
"""Enqueues retrieval job for each tenant every N hours."""
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "4"
creationTimestamp: "2022-09-19T12:49:14Z"
generation: 5
labels:
app.kubernetes.io/instance: flux-system
app.kubernetes.io/part-of: flux