Fix actions db (#761)
Go CI / Lint (push) Has been cancelled
Go CI / Check (push) Has been cancelled
Go CI / Test (mysql, 1.26, mysql:8, ubuntu-latest, 3306:3306) (push) Has been cancelled
Go CI / Test (postgres, 1.26, postgres:16, ubuntu-latest, 5432:5432) (push) Has been cancelled
Go CI / Test (sqlite, 1.26, macOS-latest) (push) Has been cancelled
Go CI / Test (sqlite, 1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, macOS-latest) (push) Has been cancelled
Go CI / Build (1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, windows-latest) (push) Has been cancelled

Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
This commit is contained in:
Thomas
2026-07-03 17:06:57 +08:00
committed by GitHub
parent 1720e886eb
commit 64e9c9aa53
4 changed files with 16 additions and 5 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ var registry = map[int]action{
ResetHooks: {run: resetHooks},
IndexGists: {run: indexGists},
SyncGistLanguages: {run: syncGistLanguages},
DeleteExpiredGists: {run: deleteExpiredGists, spec: "@every 1m"},
DeleteExpiredGists: {run: deleteExpiredGists, spec: "@every 12h"},
SyncSSHKeys: {run: syncSSHKeys, spec: "@every 72h"},
}
+1 -1
View File
@@ -11,7 +11,7 @@ import (
// keyed by Action (the action's identifier); LockedUntil holds the Unix
// timestamp the current lease expires at (0 = free).
type ActionLock struct {
Action int `gorm:"primaryKey"`
Action int `gorm:"primaryKey;autoIncrement:false"`
LockedUntil int64
}
+5 -2
View File
@@ -9,6 +9,9 @@ import DOMPurify from 'dompurify';
// security advisory describing the original markdown-cell / output sinks).
const sanitize = (html: string): string => DOMPurify.sanitize(html);
// nbformat allows `source`/`text` fields to be either a string or an array of strings.
const joinSource = (source: string | string[]): string => Array.isArray(source) ? source.join('') : source || '';
class IPynb {
private element: HTMLElement;
private cells: HTMLElement[] = [];
@@ -54,7 +57,7 @@ class IPynb {
if (output.output_type === 'stream') {
const textElement = document.createElement('pre');
textElement.classList.add('stream-output');
textElement.textContent = output.text.join('');
textElement.textContent = joinSource(output.text);
outputElement.appendChild(textElement);
} else if (output.output_type === 'display_data' || output.output_type === 'execute_result') {
if (output.data['text/plain']) {
@@ -82,7 +85,7 @@ class IPynb {
private createCellElement(cell: any): HTMLElement {
const cellElement = document.createElement('div');
const source = cell.source.join('');
const source = joinSource(cell.source);
cellElement.classList.add('jupyter-cell');
switch (cell.cell_type) {
+9 -1
View File
@@ -85,7 +85,15 @@
{{ else if $file.MimeType.IsSVG }}
<div class="p-8 flex justify-center">{{ $file.HTML | safe }}</div>
{{ else if isJupyter $file.Filename }}
<div class="p-8 jupyter notebook"><pre>{{ $file.Content }}</pre></div>
<div class="p-8 jupyter notebook">
<div class="jupyter-spinner flex justify-center p-8">
<svg class="animate-spin h-6 w-6 text-gray-400 dark:text-slate-300" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
</svg>
</div>
<pre class="hidden">{{ $file.Content }}</pre>
</div>
{{ else }}
<div class="code">
{{ $fileslug := slug $file.Filename }}