Compare commits
2 Commits
90077d110d
...
02039a14bd
| Author | SHA1 | Date | |
|---|---|---|---|
| 02039a14bd | |||
| 30c41d630e |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -0,0 +1,2 @@
|
||||
.vscode
|
||||
*.bkp
|
||||
3
bot/go.mod
Normal file
3
bot/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module lirqetes.ru/thelanc3/laura
|
||||
|
||||
go 1.25.4
|
||||
37
bot/main.go
Normal file
37
bot/main.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"lirqetes.ru/thelanc3/laura/queue"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
actions := make(chan queue.BotAction, 200)
|
||||
go actionsWorker(ctx, actions, 34*time.Millisecond)
|
||||
}
|
||||
|
||||
func actionsWorker(
|
||||
ctx context.Context,
|
||||
actions <-chan queue.BotAction,
|
||||
interval time.Duration,
|
||||
) {
|
||||
ticker := time.NewTicker(interval)
|
||||
defer ticker.Stop()
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
{
|
||||
return
|
||||
}
|
||||
case action := <-actions:
|
||||
{
|
||||
<-ticker.C
|
||||
action(ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
5
bot/queue/bot_action.go
Normal file
5
bot/queue/bot_action.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package queue
|
||||
|
||||
import "context"
|
||||
|
||||
type BotAction func(ctx context.Context)
|
||||
18
schemes.drawio
Normal file
18
schemes.drawio
Normal file
@@ -0,0 +1,18 @@
|
||||
<mxfile host="65bd71144e" pages="2">
|
||||
<diagram name="db-scheme" id="omqtpuhYFdzVFIHnakk7">
|
||||
<mxGraphModel dx="702" dy="611" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" background="none" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
<diagram id="TZAEEldzp1pVNTyIG9nr" name="lang-scheme">
|
||||
<mxGraphModel dx="702" dy="611" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
@@ -5,6 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>laura-admin-app</title>
|
||||
<script src="https://telegram.org/js/telegram-web-app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
2937
web/admin/package-lock.json
generated
Normal file
2937
web/admin/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>laura-user-app</title>
|
||||
<script src="https://telegram.org/js/telegram-web-app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
2937
web/user/package-lock.json
generated
Normal file
2937
web/user/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user