fix(tasks): 🐛 Flush not working.
This commit is contained in:
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"conventionalCommits.scopes": ["bot", "db"],
|
"conventionalCommits.scopes": ["bot", "db", "tasks"],
|
||||||
"yaml.schemas": {
|
"yaml.schemas": {
|
||||||
"kubernetes://schema/apps/v1%40deployment": "file:///c%3A/Users/rafab/Documents/Repos/Payphone-1/k8s.yml"
|
"kubernetes://schema/apps/v1%40deployment": "file:///c%3A/Users/rafab/Documents/Repos/Payphone-1/k8s.yml"
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-19
@@ -12,21 +12,26 @@ spec:
|
|||||||
targetPort: 5432
|
targetPort: 5432
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: v1
|
||||||
kind: StatefulSet
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: postgres-storage
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: openebs-hostpath # Your storage class
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 20Gi # Adjust storage as needed
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: postgresql
|
name: postgresql
|
||||||
spec:
|
|
||||||
serviceName: postgresql
|
|
||||||
replicas: 1 # Single-node PostgreSQL
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: postgresql
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
labels:
|
||||||
app: postgresql
|
app: postgresql
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
image: postgres:latest # Standard PostgreSQL image
|
image: postgres:latest # Standard PostgreSQL image
|
||||||
@@ -45,13 +50,15 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: postgres-storage
|
- name: postgres-storage
|
||||||
mountPath: /var/lib/postgresql/data
|
mountPath: /var/lib/postgresql/data
|
||||||
subPath: postgres
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- metadata:
|
|
||||||
name: postgres-storage
|
|
||||||
spec:
|
|
||||||
accessModes: [ "ReadWriteOnce" ]
|
|
||||||
storageClassName: openebs-hostpath # Your storage class
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 20Gi # Adjust storage as needed
|
cpu: "1.5"
|
||||||
|
memory: "3Gi"
|
||||||
|
limits:
|
||||||
|
cpu: "2"
|
||||||
|
memory: "4Gi"
|
||||||
|
volumes:
|
||||||
|
- name: postgres-storage
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: postgres-storage
|
||||||
|
restartPolicy: Always
|
||||||
|
|||||||
+2
-11
@@ -1,17 +1,8 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: v1
|
||||||
kind: Deployment
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: tasks
|
name: tasks
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: tasks
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: tasks
|
|
||||||
spec:
|
|
||||||
containers:
|
containers:
|
||||||
- name: flush
|
- name: flush
|
||||||
image: git.nyeki.dev/payphone/payphone-tasks:latest
|
image: git.nyeki.dev/payphone/payphone-tasks:latest
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ class Payphone(commands.AutoShardedBot):
|
|||||||
help_command=help_command.HelpCommand(),
|
help_command=help_command.HelpCommand(),
|
||||||
strip_after_prefix=True,
|
strip_after_prefix=True,
|
||||||
case_insensitive=True,
|
case_insensitive=True,
|
||||||
owner_ids=[898569996949676052, 777338793803513886],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
async def on_ready(self) -> None:
|
async def on_ready(self) -> None:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ async def flush():
|
|||||||
|
|
||||||
from payphone.core import constants, utils, config
|
from payphone.core import constants, utils, config
|
||||||
|
|
||||||
redis = redis.Redis("localhost" if config.IS_DEBUG else "redis")
|
redis = redis.Redis("redis://localhost" if config.IS_DEBUG else "redis://redis")
|
||||||
|
|
||||||
pipe = redis.pipeline()
|
pipe = redis.pipeline()
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "payphone"
|
name = "payphone"
|
||||||
version = "0.14.0"
|
version = "0.15.0"
|
||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
|
|||||||
+2
-2
@@ -264,7 +264,7 @@ class RunnableHashMixin:
|
|||||||
|
|
||||||
return self.command("HGETALL", str(key))
|
return self.command("HGETALL", str(key))
|
||||||
|
|
||||||
def hincrby(self, key: str, field: str, increment: int) -> int:
|
def hincrby(self, key: str, field: str, increment: int = 1) -> int:
|
||||||
"""Increments the number stored at field in the hash stored at key by increment.
|
"""Increments the number stored at field in the hash stored at key by increment.
|
||||||
|
|
||||||
If key does not exist, a new key holding a hash is created. If field does not exist the
|
If key does not exist, a new key holding a hash is created. If field does not exist the
|
||||||
@@ -274,7 +274,7 @@ class RunnableHashMixin:
|
|||||||
Args:
|
Args:
|
||||||
key (str): The key of the hash whose field to increment.
|
key (str): The key of the hash whose field to increment.
|
||||||
field (str): The field to increment.
|
field (str): The field to increment.
|
||||||
increment (int): The amount to increment by.
|
increment (int, optional): The amount to increment by. Defaults to 1.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
int: The amount returned
|
int: The amount returned
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import getpass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import requests
|
import requests
|
||||||
@@ -12,7 +13,7 @@ except ImportError:
|
|||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
username = input("Username for git.nyeki.dev: ")
|
username = input("Username for git.nyeki.dev: ")
|
||||||
password = input("Password for git.nyeki.dev: ")
|
password = getpass.getpass("Password for git.nyeki.dev: ")
|
||||||
|
|
||||||
tags = requests.get(
|
tags = requests.get(
|
||||||
"https://git.nyeki.dev/v2/payphone/payphone-shard/tags/list",
|
"https://git.nyeki.dev/v2/payphone/payphone-shard/tags/list",
|
||||||
|
|||||||
Reference in New Issue
Block a user